[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2240
  • Last Modified:

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?
  • 2
3 Solutions
Farhan KaziSystems EngineerCommented:
Try following

Click Start -> Run -> Cmd.exe -> OK
DSQuery Group -name "GroupNameHere" |DSGet Group -Members|DSGet user -email >Email.txt
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

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.

mishramanujAuthor Commented:
Thanks guys - worked a treat!

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now