Showing posts with label csvde. Show all posts
Showing posts with label csvde. Show all posts

Tuesday, February 1, 2011

How to extract all email distribution list from Active Directory

This is a script that I used to extract all distribution list from Active Directory. You can use a tool called csvde.exe from Microsoft to do this job easily.

csvde -f c:\temp\yourdl.csv -p subtree -l cn,mail,displayName,managedBy  -r "(|(&(objectCategory=Group)(objectClass=Group)(|(groupType=8)(groupType=4)(groupType=2)))(objectCategory=ms-Exch-Dynamic-Distribution-List)(objectClass=msExchDynamicDistributionList))" -j c:\temp -s <your domain>

You should replace <your domain> with your company's domain information