LDIF( LDAP Data Interchange Format):
The LDAP Data Interchange Format (LDIF) is a draft Internet standard for a file format that may be used for performing batch operations against directories that conform to the LDAP standards. LDIF can be used to export and import data, allowing batch operations such as add, create, and modify to be performed against the Active Directory.
Using LDIFDE to export and to import directory objects:
1. Export the user accounts from the source domain.
I have created two user account named sam and jaison under domain controller.
I have created two user account named sam and jaison under domain controller.
At the command prompt , Type:
ldifde -f <file path were you want save ldf file> -s <server name> -d "<root domain>" -p <Search Scope (Base/OneLevel/Subtree)> -r "<LDAP search filter (Default to "(objectClass=*)")>" -l "<List of attributes (comma separated) to look for in an LDAP search>"
Eg: ldifde -f c:/exportuser.ldf -s DC-01 -d "dc=mydomain,dc=com" -p subtree -r "(&(objectcategory=person)(objectclass=user)(userprincipalname=*)(givenname=*))" -l "cn,objectclass,userprincipalname,givenname,samAccountName"
User details imported to exportuser.ldf file,
Now I'm deleting both user accounts which i have created.
2. Import the users from Export to Import:At command prompt, type:ldifde -i<Import Mode> -f <source file location>Eg: ldifde -i -f "c:\exportuser.ldf"