PowerShell - Get OU GPO details to screen
- Jon Boyette
- Jan 10, 2022
- 1 min read
Save as a .ps1, Prompts for the OU to display the GPO's to it on screen
$a = Read-Host "Enter Domain OU Name to Discover GPO's applied"
Get-ADOrganizationalUnit -filter {name -like $a} -Properties name,distinguishedName,gpLink,gPOptions |Select-Object -Property *,@{
label = 'FriendlyGPODisplayName'
expression = {$_.LinkedGroupPolicyObjects | ForEach-Object {([adsi]"LDAP://$_").displayName -join ''}
}
}
Comments