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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export list of members of a distribution list

Status
Not open for further replies.

viciousdogs

Technical User
May 7, 2003
44
US
Is there an easy way to export a list of the members of an AD distribution list to a CSV file? Right now I can get a list of the DLs but without the members.

thanks
 
You can use the following command:
Code:
csvde -f groupstest.csv -s server -d "cn=Users,dc=yourdomain,dc=com" -p subtree -r "(objectClass=group)" -l "member"

This will export all groups in the Users container and their members in the following format:
"CN=groupname,CN=Users,DC=yourdomain,DC=com","CN=John Doe,CN=Users,DC=yourdomain,DC=com;CN=Jane Doe,CN=Users,DC=yourdomain,DC=com"

Hope that helps.
 
I'm still having a bit of trouble with this. I have an email distribution list named "DB". I have created a new OU named "distribution" directly under the domain root.

Should the command be:

csvde -f grouptest -s <servername> -d &quot;cn=distribution,dc=<mydomainname>,dc=<mydomainextension>&quot; -p subtree -r &quot;objectClass=DB&quot; -l &quot;member&quot;

I've tried several variations and can't get what I am looking for.

fyi. we are using the domain extension &quot;local&quot;.

 
I got this working with a few tweaks.

thanks for the help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top