Tuesday, November 24, 2015

Using LDIF to Export All Objects in the Marketing OU

  1. Click Start, point to Programs, then point to Accessories, and click Command Prompt.
  2. At the command prompt, type:
    ldifde -f marketing.ldf -s hq-res-dc-01-d"ou=Marketing,dc= reskit,dc=com"-psubtree–r"(objectCategory=CN=Person,CN=Schema,CN=Configuration,DC=reskit,DC=com)"
This creates a LDIF file named Marketing.ldf, by connecting to the server named HQ-RES-DC-01 and executing a subtree search of the Marketing OU for all objects of the category Person. (See Figure 1 below.)
Note that objectCategory is an indexed attribute designed to enhance search performance.
Bb727091.bulkst01(en-us,TechNet.10).gif
Figure 1: Creating an LDF file
You can use this LDIF file to perform a batch import of all the objects from the Marketing OU into any other LDAP-compatible directory. Some attributes may not be applicable to other implementations of LDAP. In particular, if you use this mechanism to import the objects into another Active Directory, some attributes must be omitted because they are automatically generated during object creation. (If they are not specifically omitted, the operation will fail.)
For example, the LDIFDE command that is used to omit these attributes is:
ldifde -f marketing.ldf -s hq-res-dc-01 d
"ou=Marketing,dc= reskit,dc=com"–r
>"(objectCategory=CN=Person,CN=Schema,CN=Configuration,DC=reskit,DC=com)" –m


No comments:

Post a Comment