A lightweight suite of Windows batch and PowerShell scripts to snapshot, track, and audit Group Policy (RSOP) changes over time.
This toolkit allows you to:
- Capture dated snapshots of your current Group Policy settings (
gpresult_YYYYMMDD.xml). - Compare consecutive snapshots to build a timeline of what changed (Enabled/Disabled, values added/removed).
- Pinpoint precise XML paths for every modified setting.
No installation required—just drop the scripts in a folder and run them.
| File | Description |
|---|---|
gpresult_snapshot.bat |
Captures the current policy state into a date-stamped XML file. Self-elevates if needed. |
gpresult_timeline.bat |
Generates a simple timeline text file showing line-by-line diffs (OLD vs NEW). |
gpresult_timeline_paths.bat |
Wrapper for the paths script. Runs the PowerShell logic below. |
gpresult_timeline_paths.ps1 |
Advanced comparison script that diffs XML structure and reports changed nodes with full paths. |
Run gpresult_snapshot.bat whenever you want to capture the system's policy state (e.g., daily or before/after changes).
- Action: Generates
gpresult_20251205.xml,gpresult_20251206.xml, etc. - Privileges: Prompts for Admin rights if not already elevated.
- Note: Keep all generated XML files in the same folder as the scripts.
To see a quick line-based diff of all snapshots in chronological order:
- Run
gpresult_timeline.bat. - Open
gpresult_timeline.txt. - Review the OLD vs NEW lines for every detected change.
For a robust structural analysis that shows the XML path of every changed setting (e.g., /System/Extension/PolicyName/State):
- Ensure
gpresult_timeline_paths.batandgpresult_timeline_paths.ps1are in the folder. - Run
gpresult_timeline_paths.bat. - Open
gpresult_timeline_paths.txt.
Example Output:
Changes in gpresult_20251206.xml (vs gpresult_20251205.xml):
PATH: /Computer[1]/Extension[1]/Default AutoRun Behavior[1]/q3:State[1]
OLD: Enabled
NEW: Disabled
- OS: Windows 10/11 or Windows Server.
- PowerShell: Version 5.1 or later (pre-installed on modern Windows).
- Permissions: Administrator rights required for
gpresult_snapshot.batto capture full computer policies.
- Automation: You can schedule
gpresult_snapshot.batin Windows Task Scheduler to run daily at 9 AM. - Maintenance: Old XML files can be archived or deleted; the timeline scripts simply sort and compare whatever files are present in the folder.