How to export the members of a distribution group in Exchange 2000/2003 using LDIFDE.

Author:

Todd Booher MVP

COMMUNITY SOLUTIONS CONTENT DISCLAIMER

MICROSOFT CORPORATION AND/OR ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY, RELIABILITY, OR ACCURACY OF THE INFORMATION AND RELATED GRAPHICS CONTAINED HEREIN. ALL SUCH INFORMATION AND RELATED GRAPHICS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT AND/OR ITS RESPECTIVE SUPPLIERS HEREBY DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THIS INFORMATION AND RELATED GRAPHICS, INCLUDING ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, WORKMANLIKE EFFORT, TITLE AND NON-INFRINGEMENT. YOU SPECIFICALLY AGREE THAT IN NO EVENT SHALL MICROSOFT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, PUNITIVE, INCIDENTAL, SPECIAL, CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF USE, DATA OR PROFITS, ARISING OUT OF OR IN ANY WAY CONNECTED WITH THE USE OF OR INABILITY TO USE THE INFORMATION AND RELATED GRAPHICS CONTAINED HEREIN, WHETHER BASED ON CONTRACT, TORT, NEGLIGENCE, STRICT LIABILITY OR OTHERWISE, EVEN IF MICROSOFT OR ANY OF ITS SUPPLIERS HAS BEEN ADVISED OF THE POSSIBILITY OF DAMAGES.

Tips

These steps outline how to export the members of any distribution group from Active Directory using LDIFDE.  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.
 
The distribution group DN (Distinguished Name) consists of the following:
 
     1. Distribution Group name
     2. OU that the Distribution Group resides in
     3. NetBIOS domain name
     4. Top level domain which domain resides in (usually 'com' but not always)
 
As an example, to export the members of a Distribution Group named 'Partners' in the 'Users' OU, you would use the following
syntax against the domain controller DC01 in the Microsoft.com domain:
 
ldifde -f export.ldf -d "cn=\Partners,ou=users,dc=microsoft,dc=com" -l member -s DC01
 
Your output would look like this:
 
dn: CN=\PARTNERS,OU=USERS,DC=MICROSOFT,DC=com
changetype: add
member: CN=Smith\, Bob,OU=Users,DC=microsoft,DC=com
member: CN=Smith\, Glen,OU=Users,DC=microsoft,DC=com
 
You could then take this output and view it with notepad or import it in to Excel for manipulation.  This is just one of the many
uses of ldifde.  The full syntax of the command can be viewed by typing 'ldifde' at a command prompt.  As always, fully
understand the impact of your syntax before running it against a production Active Directory.

Properties

Article ID: 555365 - Last Review: 14 Feb 2017 - Revision: 1

Microsoft Exchange Server 2003 Enterprise Edition, Microsoft Exchange Server 2003 Enterprise Edition, Microsoft Exchange Server 2003 Standard Edition, Microsoft Exchange Server 2003 Enterprise Edition, Microsoft Exchange Server 2003 Enterprise Edition, Microsoft Exchange Server 2000 Service Pack 3, Microsoft Exchange 2000 Enterprise Server

Feedback