Link to home
Start Free TrialLog in
Avatar of fireburn11
fireburn11

asked on

Replicate AD OU structure in pre-production lab

Hi All,

I need to set up a DC in our Pre-prodcution lab that replicate the same OU structures in our production AD.  and export all group policies from production DC to the PP DC.

I dont need user accounts or computer accounts replicated over. So just OUs and group policy.

We are running on 2008R2.

What would be the best way of doing this.

please advise.

Thanks
Avatar of Tasmant
Tasmant
Flag of France image

For the OU hierarchy, you can use LDIFDE (or CSVDE)
You can find reals examples here (in the zip attached) : http://www.computerperformance.co.uk/Logon/Logon_LDIFDE_example.htm
If your target domain has the same name as your production domain, you don't need to use the -c swith in the script.
Maybe you will need to add some attributes for the export, because i think you want to preserve group policy links on your OUs, therefore you will need to add attributes like gpLink and gpOptions.
But i don't know if the GUID associated in this attribute will be the same when you'ill import all GPOs objects.

For Group Policy, you can use GPMC to backup all your GPOs objects.
You can then import them in the new domain. Maybe you will need a migration table (it's a file to translate security accounts by example). I hope GUID will be preserved, else all GPOs linked will be break.
Avatar of Joseph Daly
Ok so im pretty sure this will work for you as far as creating the OU structure. This will use the DS series of tools. It will be a two step process first you will need to dump your production OUs to a text file and then if necessary change distinguished names if the domain name is different. This can be done pretty easily in excel.

So to dump all the ous for your domain you can use the following command on a computer that has the adminpak installed.

dsquery ou -limit 0 > c:\file.txt

This will dump the distinguished name of your ous like below.
"OU=Blah,DC=company,DC=com"

If necessary you can import this file into excel and then use find/replace to modify the DC=company,DC=com if it is different in your test environment.

Once you have that done you will use DSadd in your test environment to create the OUs again.

dsadd ou "OU=Blah,DC=testenvironment,DC=com"


You have two ways of doing this. You can either create a script to loop the text file or the way I do it is just use excel to autofill the dsadd ou part then copy all of the entries to a batch file and run it.

I hope this makes sense below are links to the DSquery and DSadd commands
http://tmdnet.nothave.com/book/OS/MANUALS/COMMANDS/D/DSQUERY.HTM
http://tmdnet.nothave.com/book/OS/MANUALS/COMMANDS/D/DSADD.HTM

If you have any questions let me know and i will do my best to assist.
Avatar of fireburn11
fireburn11

ASKER

Hi Tasment,

I was able to import the OU stroucturs and groups, now I really need to import the GPOs into the test envirnment.
can you be more specific about "For Group Policy, you can use GPMC to backup all your GPOs objects.
You can then import them in the new domain. Maybe you will need a migration table (it's a file to translate security accounts by example). I hope GUID will be preserved, else all GPOs linked will be break. "

Thanks alot!
ASKER CERTIFIED SOLUTION
Avatar of Tasmant
Tasmant
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
migration table is the key, Thanks