![]() |
|
|
|||||||
| Petri.co.il is happy to award auglan the title of Most Valuable Member !!! |
| Register | Calendar |
Search |
Today's Posts |
Mark Forums Read |
| Notices |
|
|
listing all users and their email addressthis thread has 7 replies and has been viewed 24517 times
|
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
#1
|
||||||||
|
||||||||
|
Hi,
I need to get a list of every user account and its corresponding email address from AD. I've tried using the ADUC find tool with a combination of options and I can get a list of every user and their email address... but I cant export this information! So I've been having a look at dsquery/dsget and adfind but im having a bit of trouble with the syntax. anyone able to point me in the right direction? I need to pull out every user in the domain, their corresponding email address and export it to CSV. cheers! |
|
#2
|
|||||||||
|
|||||||||
|
I have had to do this a lot. I am new to this forum thing, so I don't know if I am being Mr. Obvious, But have you tried "csvde -f stuff.csv" from your domain controller. Read the help to see how to narrow down the output to a given OU or object class with -d or -r. Its fun, easy, and you can learn a lot about user attributes from the 56 column excel document it exports. Good luck.
|
|
#3
|
||||||||||
|
||||||||||
|
If you have Windows Server 2003, you use the tools in 'Saved Queries' to create the query. http://www.petri.co.il/saved_queries...s_2003_dsa.htm
Finish your 'saved query' in ADU&C. Then with 'Edit', you can select and copy the query string; It will be something simular like this; (&(objectCategory=person)(objectClass=user)(mail=* )) You can use the 'filter' above with DSQUERY Start | Run: Code:
cmd /c dsquery.exe * -limit 0 -filter "(&(objectCategory=person)(objectClass=user)(mail=*))" -attr name mail >"c:\PrimaryEmailAddresses.txt" About the same results you can get when using CSVDE: Start | Run: Code:
cmd /c csvde.exe -r "(&(objectCategory=person)(objectClass=user)(mail=*))" -l name,mail -f "c:\PrimaryEmailAddresses.csv" more tools: LDAP Query Basics Daxxian gave an excellent tip how to study the Attributes. You have to know them for the output. There for in the dsquery example replace -attr name,mail with -attr * to output all the attributes of the user objects. In csvde skip -l name,mail . \Rems Last edited by Rems; 19th November 2007 at 14:17.. |
|
#4
|
||||||||
|
||||||||
|
thanks very much people!
thats exactly what I was after - now I know how to pull all sorts of data out.. cheers dave |
|
#5
|
|||||||||
|
|||||||||
|
very nice solutions but I have a problem with each one of them :
dsquery.exe -> the output text file is encodded ANSI and I need RTF Is it possible to change encoding ? csvde.exe -> the csv output file is made by 1 column of oll the data Is it possible to fraction the result by column ? (example : A column is name, B is email ...) ? |
|
#6
|
||||||||||
|
||||||||||
|
Quote:
But, why direct into RTF??? (I don't see the advantage). Quote:
If you want to create a 'Rich Text Format' file, use vbscript. Take this example. http://www.petri.co.il/forums/showpo...46&postcount=4 This still export in ascii, but when you change the extension to rtf AND add the "enRiching"-code in the script this becomes a real RTF-file, - http://www.freevbcode.com/ShowCode.Asp?ID=6326 - http://www.biblioscape.com/rtf15_spec.htm \Rems |
|
#7
|
|||||||||
|
|||||||||
|
thank you for answering.
1) I need rtf encoding for hebrew language purposes. 2) i would like separeted values for automatisation of other scripts based on this output file. I'll try. 10x once more. |
|
#8
|
||||||||||
|
||||||||||
|
Glad I could help.
You can create a sample RTF file with Wordpad.exe in your language. Then open the file with Notepad.exe to see the code. \Rems |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Default Email address for new users | spepi | Exchange 2000 / 2003 | 4 | 27th December 2006 21:03 |
| Strange LDAP email address users | texastig | SBS 2000 / 2003 | 1 | 18th March 2006 01:43 |
| Users email address is truncated when replying | awillholt | Exchange 2000 / 2003 | 4 | 21st October 2005 15:44 |
| Print out of users email address from MS Exchange or AD | poweredge4000 | Exchange 2000 / 2003 | 4 | 1st July 2005 12:51 |
| Exchange Address Name Listing? | liamw | Exchange 2000 / 2003 | 1 | 22nd October 2004 20:13 |