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 /forcefrom an administrative terminal.
Prerequisites: This script has no prerequisites.
Script
Examples
.\ResetLocalPolicies.ps1This 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
Was this helpful?