How Can we export an email list of group members?

Posted on 2007-10-10
Last Modified: 2008-10-08
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?
Question by:mishramanuj
    LVL 26

    Accepted Solution

    Try following

    Click Start -> Run -> Cmd.exe -> OK
    DSQuery Group -name "GroupNameHere" |DSGet Group -Members|DSGet user -email >Email.txt
    LVL 26

    Assisted Solution

    * 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

    LVL 3

    Assisted Solution

    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.


    Author Comment

    Thanks guys - worked a treat!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Suggested Solutions

    Granting full access permission allows users to access mailboxes present in their database. By giving full access permission one can open and read the content of any mailbox but cannot send emails from that mailbox.
    Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
    In this video we show how to create a mailbox database in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Servers >> Data…
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now