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.18. Restoring a GPO

Problem

You want to restore a 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 GPO you want to back up, and expand the Group Policy Objects container.

  3. Right-click on the GPO you want to restore, and select Restore from Backup.

  4. Click Next.

  5. Select the backup folder location and click Next.

  6. Select the backup you want to restore and click Next.

  7. Click Finish.

  8. You will see the restore status window. After it completes, click OK to close the window.

Using a command-line interface

> restoregpo.wsf "<BackupFolder>" "<GPOName>"

Using VBScript

' This code restores a GPO from a back up.
' ------ SCRIPT CONFIGURATION ------
strGPO      = "<GPOName>"       ' e.g. Sales Users GPO
strDomain   = "<DomainDNSName>" ' e.g. rallencorp.com
strLocation = "<BackupFolder>"  ' e.g. c:\GPMC Backups
strBackupID = "<BackupGUID>" ' e.g. {85CA37AC-0DB3-442B-98E8-537291D26ED3} ' ------ END CONFIGURATION --------- set objGPM = CreateObject("GPMgmt.GPM") set objGPMConstants = objGPM.GetConstants( ) ' Initialize the Domain object set objGPMDomain = objGPM.GetDomain(strDomain, "", objGPMConstants.UseAnyDC) ' Make sure backup location and ID are valid set objGPMBackupDir = objGPM.GetBackupDir(strLocation) set objGPMBackup = objGPMBackupDir.GetBackup(strBackupID) WScript.Echo "Backup found:" WScript.Echo " ID: " & objGPMBackup.ID WScript.Echo " Timestamp: " & objGPMBackup.TimeStamp WScript.Echo " GPO ...
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