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 ...
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.
Read now
Unlock full access