Skip to Content
Active Directory Cookbook
book

Active Directory Cookbook

by Robbie Allen
September 2003
Intermediate to advanced
624 pages
15h 49m
English
O'Reilly Media, Inc.
Content preview from Active Directory Cookbook

9.3. Copying a GPO

Problem

You want to copy the properties and settings of a GPO to another GPO.

Solution

Using a graphical user interface

  1. Open the GPMC snap-in.

  2. In the left pane, expand the Forest container, expand the Domains container, browse to the domain of the source GPO, and expand the Group Policy Objects container.

  3. Right-click on the source GPO and select Copy.

  4. Right-click on the Group Policy Objects container and select Paste.

  5. Select whether you want to use the default permissions or preserve the existing permissions, and click OK.

  6. A status window will pop up that will indicate whether the copy was successful. Click OK to close.

  7. Rename the new GPO by right-clicking it in the left pane and selecting Rename.

Using a command-line interface

> copygpo.wsf <SourceGPOName> <TargetGPOName>

Using VBScript

' This code copies a source GPO to a new GPO
' ------ SCRIPT CONFIGURATION ------
strSourceGPO  = "<SourceGPOName>"  ' e.g. SalesGPO
strNewGPO     = "<NewGPOName>"     ' e.g. Marketing GPO
strDomain     = "<DomainDNSName>" ' e.g. rallencorp.com ' ------ END CONFIGURATION --------- set objGPM = CreateObject("GPMgmt.GPM") set objGPMConstants = objGPM.GetConstants( ) ' Initialize the Domain object set objGPMDomain = objGPM.GetDomain(strDomain, "", objGPMConstants.UseAnyDC) ' Find the source GPO set objGPMSearchCriteria = objGPM.CreateSearchCriteria objGPMSearchCriteria.Add objGPMConstants.SearchPropertyGPODisplayName, _ objGPMConstants.SearchOpEquals, cstr(strSourceGPO) set objGPOList = objGPMDomain.SearchGPOs(objGPMSearchCriteria) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Active Directory Administration Cookbook

Active Directory Administration Cookbook

Sander Berkouwer
Active Directory Cookbook, 3rd Edition

Active Directory Cookbook, 3rd Edition

Laura E. Hunter, Robbie Allen
Active Directory Cookbook, 4th Edition

Active Directory Cookbook, 4th Edition

Brian Svidergol, Robbie Allen

Publisher Resources

ISBN: 0596004648Supplemental ContentCatalog PageErrata