Export Email Addresses from a Distribution Group

One thing that really bugs me is there is no easy way to grab some email addresses from a distribution group.  Usually I end up expanded the group to list all the users and then I have to go to the Outlook properties of each user to view the email address.  Heck, I can’t even copy the email address from there…instead I have to write it down.  This can be a pain for companies that have long complex email addresses.

I’ve finally figured out a way to export this info into a text file…no one said I was quick.  :,,)  To do this you just need to use either CSVDE or LDIFDE.  I use mail as the attribute I pull from these commands but you could really use any AD attribute that you want to pull.

csvde -f c:tempreport.txt -r "memberOf=cn=group name,ou=ou name,dc=domain,dc=name" -l mail

ldifde -f c:tempreport.txt -r "memberOf=cn=group name,ou=ou name,dc=domain,dc=name" -l mail

This may not be the cleanest way to pull this data but at least now I can copy and paste the email addresses.

1 Comment

  1. Christine says:

    Thanks for this script! I had to forward some distribution group info to someone outside of our company, and this created exactly what I was looking for.

Leave a comment

*