Inventory GPOs
Documentation: Microsoft Learn
Get-GPO -All enumerates every policy object in the domain and the projection keeps the display name with its GUID and both timestamps.
The script
Script reader
Inspect before you run
Inspect the script below. It does not run in this browser.
Inspection only — no command has run.
Show reference output
Inspect this example’s structure
Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.
Get-GPO -All | Select-Object DisplayName,Id,CreationTime,ModificationTime- Stage 1Get-GPO
-All - Stage 2Select-Object
Positional values or no named parameters
How it works
Get-GPO -All enumerates every policy object in the domain and the projection keeps the display name with its GUID and both timestamps. That GUID matters because display names are not unique, and the GUID is what shows up in gpresult output and in the SYSVOL folder layout.
Adapting it
Sort on ModificationTime and pipe into Where-Object to isolate policies untouched for years, which is the candidate list a cleanup project actually starts from.
Requirements
GroupPolicy module, which installs separately from the ActiveDirectory RSAT feature.
If the result is unexpected
A GPO is absent from the inventory or appears under an unexpected name.
The query may target another domain, and display names are not stable identifiers.
- Confirm the domain and locate the policy by GUID as well as display name.
Validate the result
The expected GUID appears in the selected domain inventory.
Keep the check reliable
Store GPO GUIDs with names so renames do not look like removal and creation.