Monday 26 February 2007

Export Members of a Distribution List

There are different ways to export members of a Distribution List. You can buy commercial tools, use CSVDE, LDIFDE, DSGET tools or even write you own scripts.

I have found using Outlook itself to retrieve DL members is simple and fast. If you want to directly export the members of a DL to a csv file, LDIFDE is also a good tool to use.
Open Outlook 2003 and create a new email with the address of the DL. Right click on the DL appearing in the address field, and choose Expand DL. Or click on the + sign in front of the DL address. (Figure 1)


Figure 1
If the DL does not expand to show members, you need to unhide the membership in Active Directory Users and Computers snap-in. Right-click the DL, and click Exchange Tasks. Click Next and Unhide Membership,
Then you can copy all the members to a csv or txt file.

LDIFDE is also simple to use. The syntax required looks like this:

ldifde -f export.ldf -d "cn=\distribution group DN" -l member -s server

-f specifies the file name to save the data to.
-d specifies the RootDN (basically where the search starts).
-l specifies what parameter you are interested in (in this case we are looking at the 'member' attribute.)
-s specifies which Active Directory Domain Controller to use.

On a Domain Controller server or your Exchange server, open Command prompt and type in

ldifde -f c:\temp\wildlifeDL.csv –d “cn=\wildlife, ou=Distribution Lists, dc= allabboutexchange, dc=net” –l member

Now go to c:\temp and get your file.

No comments: