Find unlinked GPOs with PowerShell

preview_player
Показать описание
In this video, I show you how to find unlinked GPOs with PowerShell. Unlinked GPOs are not linked to any Active Directory site, domain or organizational unites so they are not being used. You can review these unlinked GPOs and determine if they should be deleted.

Windows admins create GPOs for testing or are implementing on a temporary basis. When you deleted a linked GPO in the group policy console it doesn't delete the GPO object. Overtime this can lead to a large number of GPOs that are not in use. With the group policy management console you have to select the GPO one at a time to determine if it is linked or not.

With PowerShell you can find all unlinked (unused) GPOs with the command below.

Get-GPO -All | Sort-Object displayname | Where-Object { If ( $_ | Get-GPOReport -ReportType XML | Select-String -NotMatch "LinksTo" ) {$_.DisplayName } } | select DisplayName, CreationTime, ModificationTime

With the AD Pro Toolkit click on Group Policy Reports and run the "Unlinked GPOs" report.

The AD Pro Toolkit includes over 200 built in reports.
Рекомендации по теме