Get all GPO’s in a Domain  

$groupname = "domain.com\group.name"  

$AllGPOs = Get-GPO -all | sort DisplayName #| Where-Object {$_.Displayname -like "whatever.*"}  
Write-Host "Found $($AllGPOs.Count) GPOs in the domain!" 

Foreach($gpo in $AllGPOs) { 
    Write-Host "Checking $($gpo.DisplayName)..." 
    get-gppermission -Guid $gpo.Id -TargetName $groupname -targettype Group -ErrorAction SilentlyContinue 
} 

Leave a Reply

Your email address will not be published. Required fields are marked *