A while back I wrote a couple of scripts for backing up Group Policies and then importing that backup into a test environment. More on those scripts here:
Notice the use of 'comprehensive' in the script titles. I chose this word because there were a couple of things the scripts didn't do. One of those things was to mirror the OU structure of the source domain to the target domain. This is no longer an issue...
Let me introduce a couple of companion scripts to ensure we have a matching OU structure in the test environment:
The names give the script functions away:
- the first script dumps the OU name, OU DN, OU parent DN and domain DN to an XML file
- the second script reconstructs the OU structure in a target test domain
No OUs were hurt in the production of this post...