How Can we export an email list of group members?

Hi guys we need to export a list of emails from an AD group of users? Im sure there is an easy way to output the email addresses but I cant figure it out.

I have used net group /domain >c:\members.txt but that just lists members and not there email addresses.

Any one got a clue?
mishramanujAsked:
Who is Participating?
 
Farhan KaziSystems EngineerCommented:
Try following

Click Start -> Run -> Cmd.exe -> OK
DSQuery Group -name "GroupNameHere" |DSGet Group -Members|DSGet user -email >Email.txt
0
 
Farhan KaziSystems EngineerCommented:
* To get email address along with user ID try following statement.

DSQuery Group -name "GroupNameHere" |DSGet Group -Members|DSGet user -samid -email >Email.txt


* To get email address along with user display name try following statement.

DSQuery Group -name "GroupNameHere" |DSGet Group -Members|DSGet user -display -email >Email.txt

0
 
Kristofer NurmiaLead System AdminCommented:
Have you tried using the dsget command? On a Windows 2003 server, this should work:
dsget "CN=Test Group, OU=Test OU, DC=Test, DC=Local" -members | dsget user -samid -email.

Of cource you have to replace the example distinguished name with your own values.

Kristofer
0
 
mishramanujAuthor Commented:
Thanks guys - worked a treat!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.