DESKTOP

Windows Server 2008 and Windows Vista : Copying and Importing GPOs

11/13/2013 8:24:11 PM

To efficiently utilize existing GPOs and their settings, you can use the copy and import features within the GPMC and the following scripts. The copy option allows a company to move GPOs efficiently from a test domain to a production domain, without having to manually duplicate the settings from one environment to the other.

1. CopyGPO.wsf

This script copies a GPO from one domain to another. This is ideal for moving GPOs from a test domain to production domain, or any other situation in which two domains need duplicate GPOs. If the GPO contains UNC paths or security principal references, the migration tables must be used to translate them from one domain to another.

Syntax
Usage: CopyGPO.wsf SourceGPO TargetGPO [/SourceDomain:value] [/TargetDomain:value]
[/SourceDC:value] [/TargetDC:value] [/MigrationTable:value] [/CopyACL]
SourceGPO: Name of the source GPO.
TargetGPO: Name of the target GPO.
SourceDomain: DNS name of the source domain.
TargetDomain: DNS name of the target domain.
SourceDC: Domain controller to use in the source domain.
TargetDC: Domain controller to use in the target domain.
MigrationTable: Migration table to use.
CopyACL: Copies the ACL on the GPO.


Example

This script copies the contents of GPO1 from the test.fabrikam.com domain and places the contents into GPO1 located in the production.fabrikam.com domain.

cscript CopyGPO.wsf GPO1 GPO1 /SourceDomain:test.fabrikam.com
/TargetDomain:production.fabrikam.com

2. ImportGPO.wsf

This script imports the settings from a backed-up GPO into an existing (target) GPO. If there is more than one version of the backed-up GPO, the latest is used. If you want to use a version other than the latest backed-up GPO for importing the settings, you must specify the Backup ID in the script. If you do not specify a target GPO, the target will be the name of the GPO backup. If a GPO exists with that name, the script imports the information into the existing GPO. If a GPO does not exist with that name, and you use the CreateIfNeeded switch, the script will create a new GPO in that name. You can use a migration table to handle any UNC paths or security principals must be translated during the import to the existing GPO.

Importing a GPO does not restore delegation information. To restore delegation information for a GPO, use the RestoreGPO.wsf script.

Syntax
Usage: ImportGPO.wsf BackupLocation BackupID [TargetGPO] [/MigrationTable:value]
[/CreateIfNeeded] [/Domain:value]
BackupLocation: File system location where the backup is located.
BackupID: GPO name or backup ID (GUID) of the backup to use.
TargetGPO: Target GPO in which to import settings.
MigrationTable: Optional migration table to use when importing.
CreateIfNeeded: Creates a new GPO if the specified target GPO does not exist.
Domain: DNS name of domain.


Example

This script takes the contents from the GPO with the specified GUID and copies them to a new GPO, named GPO1. The script specifies that the new GPO should be created if it does not already exist.

cscript ImportGPO.wsf \\Server1\gpo-backup {73624CC9-E8F2-4F05-88D2-193FAE8773CE} GPO1
/CreateIfNeeded


3. ImportAllGPO.wsf

This script creates a new GPO for every GPO that you have backed up in the reference backup location. The script uses only the latest version of the GPO from the backup location. The new GPO will maintain the same name as the GPO that you backed up. This script will not account for duplicate GPO names, so if there are existing target GPOs with the same name as those in the backup location, the script will overwrite the existing GPOs with the new GPO you are importing. Any settings you created in the existing GPO will be lost.

Syntax
Usage: ImportAllGPOs.wsf BackupLocation [/MigrationTable:value] [/Domain:value]
BackupLocation: File system location containing the GPO backups.
MigrationTable: Optional Migration table to use when importing.
Domain: DNS name of domain.


Example

This script takes all GPOs that have been archived to the gpo-backup share and imports the settings into existing (or new) GPOs, using the settings in the migration table named MigrationTable1.xml.

cscript ImportAllGPOs.wsf \\Server1\gpo-backup /MigrationTable:"G:\MigrationTable1.xml"				  
Other  
  •  Windows Server 2008 and Windows Vista : Backing Up and Restoring GPOs (part 2)
  •  Windows Server 2008 and Windows Vista : Backing Up and Restoring GPOs (part 1)
  •  Windows Small Business Server 2011 : Creating Custom Alerts - Creating an Alert for a Stopped Service, Custom Alert for Backup Failure
  •  Windows Small Business Server 2011 : Configuring Alerts - Alerts for Services, Performance Counter Alert, Event Log Error Alerts
  •  Windows Small Business Server 2011 : Network Reports (part 2) - Customizing the Detailed Network Report
  •  Windows Small Business Server 2011 : Network Reports (part 1) - Customizing the Summary Report
  •  Windows 8 : Diagnosis and Recovery - Windows Recovery Environment
  •  Windows 8 : Diagnosis and Recovery - Refresh and Reset
  •  Windows 8 : Diagnosis and Recovery - The Startup, Users, Details, and Services Tabs
  •  Windows Server 2008 R2 networking : Network Monitoring and Troubleshooting Utilities
  •  
    Most View
    Sony Xperia Z Review (Part 2)
    Lenovo IdeaTab Lynx - A Pretty Nice Windows 8 Tablet (Part 2)
    Sony Vaio Fit 15 - A Fast Laptop With A Good Quality, High-Resolution Screen
    HTC One X+ - A Big Plus For This One
    Android Application Development : Drawing 2D and 3D Graphics - Bling (part 2) - Animation - Transition animation
    Adobe Acrobat Pro XI - Significant Increase For PDF Management
    Installing or Upgrading Windows 8 : Preparing Your System: A Checklist
    Canon EOS C500 and EOS-1DC: 4K Cameras Now!
    Haswell Ultrabooks Shootout Featherweight Battle Royale (Part 3) - Sony VAIO Pro 13, Toshiba PORTEGE Z30
    Windows Vista : Migrating User State Data - Installing USMT, Understanding USMT Components
    REVIEW
    - First look: Apple Watch

    - 3 Tips for Maintaining Your Cell Phone Battery (part 1)

    - 3 Tips for Maintaining Your Cell Phone Battery (part 2)
    VIDEO TUTORIAL
    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 1)

    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 2)

    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 3)
    Popular Tags
    Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Indesign Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe After Effects Adobe Photoshop Adobe Fireworks Adobe Flash Catalyst Corel Painter X CorelDRAW X5 CorelDraw 10 QuarkXPress 8 windows Phone 7 windows Phone 8 BlackBerry Android Ipad Iphone iOS
    Top 10
    3 Tips for Maintaining Your Cell Phone Battery (part 2) - Discharge Smart, Use Smart
    3 Tips for Maintaining Your Cell Phone Battery (part 1) - Charge Smart
    OPEL MERIVA : Making a grand entrance
    FORD MONDEO 2.0 ECOBOOST : Modern Mondeo
    BMW 650i COUPE : Sexy retooling of BMW's 6-series
    BMW 120d; M135i - Finely tuned
    PHP Tutorials : Storing Images in MySQL with PHP (part 2) - Creating the HTML, Inserting the Image into MySQL
    PHP Tutorials : Storing Images in MySQL with PHP (part 1) - Why store binary files in MySQL using PHP?
    Java Tutorials : Nested For Loop (part 2) - Program to create a Two-Dimensional Array
    Java Tutorials : Nested For Loop (part 1)