seems promising but really couldn’t get it to run with out errors. I’ve tried replacing certain values with those in my environment but missing something. I’d be seeking all GPOs with the “DEV-” in the name and linked.
Function Get-AllGPO
{
Get-GPOReport -all -ReportType xml | %{
([xml]$_).gpo | select name,@{n="SOMName";e={$_.LinksTo | % {$_.SOMName}}},@{n="SOMPath";e={$_.LinksTo | %{$_.SOMPath}}}
}
}
#Get Gpo with name Turn* and display what OU is linked.
Get-AllGPO | ? {$_.Name -match "DEV-"} | %{$_.SomName}
…not sure why the author would use a pipeline variable like this $_.SOMName however…