This is one of the regular task that we have to perform
during Domain migration activities. So, today we will learn how to Copy\Mirror
OU structure from one domain to another domain.
For my case, I used “LDIFDE” command to export and import
the OU’s from one domain to another domain.
1.
Login to the Source Domain domain controller
with sufficient privileges (Domain admin).
2.
Execute below command on Elevated command prompt
ldifde -f c:\Temp\OUs.ldf -r “(objectClass=organizationalUnit)” -l
objectClass,description
3.
This command will export all OU’s from the
source domain and create a LDF file with the name “Ous.LDF” in the directory
C:\Temp
k Copy this file on Destination domain domain
controller and edit with notepad as we need to modify the Distinguish domain
name based on Target domain name.
1.
Replace Distinguish name for all OU’s with the
new domain distinguish Domain name.
a.
Ex : dc=testenv,dc=local entries
with the new domain’s DN dc=testcorp,dc=local
1.
Remove the Domain controller OU information from
the LDF file as it will come by default on all domains and it is not required
to import again in target domain.
1.
Now file is ready and run below command with
elevated command prompt on Target Domain domain controller.
a.
ldifde -i -f c:\Temp\OUs.ldf
Thanks,
Baji Nannam