Using PowerShell to back up and restore GPOs

by Mitch Tulloch [Published on 17 Dec. 2014 / Last Updated on 17 Dec. 2014]

A tip on how you can use Windows PowerShell to back up and restore Group Policy Objects.

You can use the Backup-GPO and Restore-GPO cmdlets to back up GPOs and restore them. For example, the following command backs up the GPO named "HQ-Desktops" to the local folder named C:\GPOBackups:

PS C:\> Get-GPO -Name "BO-1-Desktops" | Backup-GPO -Path "C:\GPOBackups" `
-Comment "Today's backup"

You can then use the Get-ChildItem cmdlet to verify the result as follows:

PS C:\> Get-ChildItem "C:\GPOBackups" -Recurse

The above tip was excerpted from Mitch Tulloch's book Training Guide: Installing and Configuring Windows Server 2012 from Microsoft Press.

Mitch is a nine-time recipient of the Microsoft Most Valuable Professional (MVP) award and a widely recognized expert on Windows administration, deployment and virtualization.  For more information see http://www.mtit.com.

See Also


The Author — Mitch Tulloch

Mitch Tulloch is a well-known expert on Windows Server administration and cloud computing technologies. He has published over a thousand articles on information technology topics and has written, contributed to or been series editor for over 50 books.

Featured Links