Restoring a GPO

We know that there are two different ways to restore a GPO inside GPMC—one to overwrite a current GPO with an older version (rolling it back), and another restoration process that brings back a GPO that has been completely deleted from Group Policy. Weirdly, you can only use PowerShell's Restore-GPO to do the rollback version, recovering a GPO back to a previous version if the GPO still exists. This is because the PowerShell cmdlet to restore GPOs is going to look for the name of the GPO to perform the restoration, and if that name is missing it won't know what to do.

So, if you do have the need to restore a fully deleted GPO using PowerShell, you would have to first create a new GPO with the exact same name as the GPO that got deleted, and then perform the restoration command. Just a heads-up on that.

Regardless, it's good to cover the bases and make sure you have the information needed in order to restore a GPO from PowerShell, in the event that you're ever asked to do so. Here is a command to restore MyNewGPO from a previous copy that is stored inside C:GPO_Backups:

Restore-GPO -Name "MyNewGPO" -Path C:GPO_Backups
You see in the command that I did not specify anything about a particular backup file from which to restore. The Restore-GPO cmdlet automatically assumes that you want to recover the GPO to the newest backup file, so it goes ahead and does that. If you had multiple backup copies inside that folder and wanted to specify a particular one, you could additionally provide the -BackupID parameter in your command to specify a particular version of the backup.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.174.218