9.7. Importing Settings into a GPO
Problem
You want to import settings from one GPO to another.
Solution
Using a graphical user interface
Open the GPMC snap-in.
In the left pane, expand the Forest container, expand the Domains container, browse to the domain of the target GPO, and expand the Group Policy Objects container.
Right-click on the target GPO and select Import Settings.
Click Next.
Click the Backup button if you want take a backup of the GPO you are importing into.
Click Next.
Select the backup folder location and click Next.
Select the backup instance you want to import from and click Next.
It then will scan to see if there are any security principals or UNC paths in the GPO being imported from. If there are, it will give you an option to modify those settings.
Click Next.
Click Finish.
Using a command-line interface
> importgpo.wsf "<GPOBackupLocation
>" "<OrigGPOName
>" "<NewGPOName
>"
Using VBScript
' This code imports the settings from a GPO that has been backed up into ' an existing GPO. ' ------ SCRIPT CONFIGURATION ------ strGPOImportTo = "<GPOName
>" ' e.g. Sales GPO strDomain = "<DomainDNSName
>" ' e.g. rallencorp.com strBackupLocation = "<BackupLocation
>" ' e.g. c:\GPMC Backups ' GUID representing specific backup ' e.g.{3E53B39B-C29B-44FF-857B-8A84528804FF} strBackupID = "<BackupGUID
>" ' ------ END CONFIGURATION --------- set objGPM = CreateObject("GPMgmt.GPM") set objGPMConstants = objGPM.GetConstants( ) ' Initialize the Domain object set objGPMDomain = objGPM.GetDomain(strDomain, ...
Get Active Directory Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.