Directory Services

Exporting LDAP Directory Objects

[This documentation is preliminary and subject to change.]

This example uses DSDE to export employee data from one LDAP directory to a file. It reformats the data so that it can be imported to the fabrikam.com Active Directory.

This example runs from a command line. To open a command prompt window, click Start on the taskbar and then click Command Prompt.

C:\Documents and Settings\MyUserName> cd \program files\microsoft\dsde
C:\Program Files\Microsoft\DSDE> dsde /mode export 
									/query (sn=Smith)
									/baseDN OU=myProject,O=myCompany
									/scope oneLevel 
									/server localhost 
									/protocol LDAP 
									/port 1026
									/output employees.xml
									/replace OU=myProject,O=myCompany CN=Users,DC=fabrikam,DC=com
									/outRequest
									/attributes name,sn,givenName,title,telephoneNumber,objectClass

Note  For clarity, the command line is shown divided into several lines. Normally, it would be entered all on one line.

The command line options used in this example perform the following functions:

The following is a partial listing of the resulting employees.xml output file.

<batchRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
			 xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
			 xmlns="urn:oasis:names:tc:DSML:2:0:core">
  <addRequest dn="CN=Jeff Smith,CN=Users,DC=fabrikam,DC=com">
	<attr name="objectClass">
	<value>top</value>
	<value>person</value>
	<value>organizationalPerson</value>
	<value>user</value>
	</attr>
	<attr name="sn">
	<value>Smith</value>
	</attr>
	<attr name="title">
	<value>Developer</value>
	</attr>
	<attr name="telephoneNumber">
	<value>(425) 555-0174</value>
	</attr> 			 
	<attr name="givenName">
	<value>Jeff</value>
	</attr>
	<attr name="name">
	<value>Jeff Smith</value>
	</attr>
  </addRequest>
  <addRequest dn="CN=Jeff Smith,CN=Users,DC=fabrikam,DC=com">
	<attr name="objectClass">
	<value>top</value>
	<value>person</value>
	<value>organizationalPerson</value>
	<value>user</value>
	</attr>
	<attr name="sn">
	<value>Smith</value>
	</attr>
	<attr name="title">
	<value>Program Manager</value>
	</attr>
	<attr name="telephoneNumber">
	<value>(425) 707-9798</value>
	</attr> 			 
	<attr name="givenName">
	<value>Jeff</value>
	</attr>
	<attr name="name">
	<value>Jeff Smith</value>
	</attr>
  </addRequest>
</batchRequest>