Replicate AD OU structure in pre-production lab

Posted on 2011-02-11
Medium Priority
Last Modified: 2012-05-11
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.

Question by:fireburn11
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 11

Expert Comment

ID: 34878421
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.
LVL 35

Expert Comment

by:Joseph Daly
ID: 34879367
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.

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

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

Author Comment

ID: 34993670
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!
LVL 11

Accepted Solution

Tasmant earned 2000 total points
ID: 35012072

Author Comment

ID: 35085790
migration table is the key, Thanks

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Active Directory security has been a hot topic of late, and for good reason. With 90% of the world’s organization using this system to manage access to all parts of their IT infrastructure, knowing how to protect against threats and keep vulnerabil…
Microsoft Office 365 is a subscriptions based service which includes services like Exchange Online and Skype for business Online. These services integrate with Microsoft's online version of Active Directory called Azure Active Directory.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.
Suggested Courses
Course of the Month13 days, 21 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question