This PowerShell script resets the group policies on a Windows client to their default settings. It also writes an informational event to the Event Viewer.
- Windows operating system
- PowerShell 5.1 or higher
- Administrator privileges
- Open an elevated PowerShell console (Run as Administrator).
- Navigate to the directory containing the script.
- Run the script using the following command:
.\Reset-GroupPolicy.ps1 [-Verbose] [-Help]
-Verbose
: Enable verbose logging. When this switch is used, the script will print detailed information about its progress to the console.-Help
: Show a help message with a description of the command-line options.
To run the script with verbose logging, use the following command:
.\Reset-GroupPolicy.ps1 -Verbose