Reset Local Group Policy
PowerShell script to silently backup and reset existing local group policy objects.
Overview
This script creates a backup of the files stored in C:\Windows\System32\GroupPolicy
and C:\Windows\System32\GroupPolicyUsers
. After the backup is created, the script will delete the existing files to reset all locally set Group Policy Objects to "Not Configured".
By default, backups are stored in C:\Backups\Group Policy
.
To restore a backup:
Delete contents of
C:\Windows\System32\GroupPolicy
, if it exists.Delete contents of
C:\Windows\System32\GroupPolicyUsers
, if it exists.Copy the contents of the associated backup folder to
C:\Windows\System32
.Run
gpupdate /force
from an administrative terminal.
Prerequisites: This script has no prerequisites.
Script
Note: This script has no effect on Group Policy Objects applied from Active Directory.
Examples
This example creates a backup of the existing local group policy files (if any) and resets them back to "Not Configured".
Parameters
This script has no parameters.
Last updated