PowerShell : Identify unused GPO with ZZZ_

A nice and quick one for you. This will find any group policy objects that you have in your domain that are not in use and prefix them with 'zzz_' thus making them easy to spot.

Import-Module GroupPolicy
$Oprhans = Get-GPO -All | Sort-Object displayname | Where-Object { If ( $_ | Get-GPOReport -ReportType XML | Select-String -NotMatch "<LinksTo>" ) {$_.DisplayName } }

Foreach ($Oprhan in $Oprhans)

{
$Oldname = $Oprhan.DisplayName
$Newname = "ZZZ_" + $Oldname
Rename-GPO -Name $Oldname -TargetName $Newname
}