Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export usernames, email addresses from AD to Excel or Access

Status
Not open for further replies.

sjptarlo

MIS
Jun 1, 2005
16
GB
Hi,

Is there a script i can run to export AD data to excel or access?

thanks
 
check out thread

"Compare Homedrives vs. UIDs" about 4 below your one.

also have a search for 'excel' in this forum and you will find plenty of examples of writing to excel.

worst case you can

cscript.exe > c:\results.csv

then you in your script have

Wscript.Echo strUserName & "," & strEmailAddress
 
Any chance you could be less explicit? What didn't work? Did you get an error? What was the error? What code exactly were you running? What line did it error on? What output did you get? How is this different from what you expected?

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
On a domain controller run the following command...

csvde -f c:\userdump.csv -r "(&(objectClass=user)(objectCategory=person))" -l "displayName,sAMAccountName,mail"

This will dump all the users in your domain to a CSV file and include the Distinguished Name, Display Name, "Pre-Windows 2000" Logon name, and the primary SMTP address.

PSC

Governments and corporations need people like you and me. We are samurai. The keyboard cowboys. And all those other people out there who have no idea what's going on are the cattle. Mooo! --Mr. The Plague, from the movie "Hackers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top