For the complete documentation index, see llms.txt. This page is also available as Markdown.

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:

  1. Delete contents of C:\Windows\System32\GroupPolicy, if it exists.

  2. Delete contents of C:\Windows\System32\GroupPolicyUsers, if it exists.

  3. Copy the contents of the associated backup folder to C:\Windows\System32.

  4. 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.

https://github.com/wise-io/scripts/blob/main/scripts/ResetLocalPolicies.ps1

Examples

.\ResetLocalPolicies.ps1

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