#Parse XML "<LinksTo>\<SOMPath>" looking for $null entries. Output list.
#Can take a few minutes to run
$unlinkedGPOs = New-Object System.Collections.Generic.List[System.Object]
$GPOs = Get-GPO -All
ForEach ($gpo in $GPOs)
{
[xml]$gpoxml = Get-GPOReport -guid $gpo.Id -ReportType xml
if(($gpoxml).GPO.LinksTo.SOMPath -eq $null)
{
$unlinkedGPOs.add($gpoxml.gpo.name)
}
}
$unlinkedGPOs | out-gridview
No comments:
Post a Comment