Example: Creating an XML Format File from a Production Environment
Updated: March 28, 2003
Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2
Assume that your production domain is called Contoso.com, and you want to export Group Policy and related information to create a new staging domain for GPO testing. In this example, assume that you want to capture GPOs from the entire domain and include user accounts as well as groups. To export the information you need, complete the following tasks:
Ensure that you have sufficient permissions on the production domain to extract the necessary data. You must have the rights to read all objects that you are capturing, including GPOs, OUs, users, and groups (and their memberships).
Create a folder to store the XML format file that describes the information collected by the script.
Create a folder to store backups of the GPOs that are extracted by the script.
Run the script CreateXMLFromEnvironment.wsf from the Scripts folder in the GPMC installation folder. You must precede the script name with the command
cscriptif cscript.exe is not your default WSH engine. For this example, type the following from the command line:
Cscript "%programfiles%\gpmc\scripts\CreateXmlFromEnvironment.wsf".\production.xml /Domain:contoso.com /DC:contoso-dc1 /TemplatePath:.\GPObackups /IncludeUsers
The script starts its capture at the domain level, Contoso.com. You can also run the script at an OU level, in which case you would use the /StartingOU option in addition to the /Domain option. If you exclude the /Domain option, the current domain is assumed. The /DC option tells the script to use the domain controller contoso-dc1, and the /TemplatePath option specifies that the backups of all of the GPOs that are captured are stored in the folder GPOBackups. Finally, the /IncludeUsers option ensures that user accounts are captured by the script as well.
You can open and edit the XML format files produced by the script CreateXMLFromEnvironment.wsf in a text editor or any XML editor. Be aware, however, that XML-formatted files must adhere to a specific syntax. If you change that syntax, you might affect the ability of the script CreateEnvironmentFromXML.wsf to read the input file.
- You can open and edit the XML format files produced by the script CreateXMLFromEnvironment.wsf in a text editor or any XML editor. Be aware, however, that XML-formatted files must adhere to a specific syntax. If you change that syntax, you might affect the ability of the script CreateEnvironmentFromXML.wsf to read the input file.
Once you have captured the production environment by running the script CreateXMLFromEnvironment.wsf, you need to run the script CreateEnvironmentFromXML.wsf, using the .XML format file output by CreateXMLFromEnvironment.wsf as input. You must run the script CreateEnvironmentFromXML.wsf, from within the staging domain, or you can run this script from a computer that is not in the staging domain if you already have trusts to the staging domain in place.