## Find all links to a GPO and convert SOM path to a Distinguished Name so can be passed to Remove-GPLink
([xml](Get-GPOReport -Name "Name of the GPO" -ReportType Xml)).GPO.LinksTo|where sompath -match "Regex matching OUs of interest" | select SOMPath,Enabled,@{n='DN';e={$p = $_.SOMPath.split('/') ;"OU=$($p[($p.Count - 1)..1] -join ',OU='),DC=$($p[0].Split('.') -join ',DC=')"}}