# Store username and group in variables$username = 'OFFICE\hhogan'$group = 'OFFICE\GPO Managers'# Store GPOs in a variable$gpos = Get-NetGPO# Get the ACLs on each GPO$gpoAcls = $gpos | ForEach-Object { Get-ObjectAcl -ResolveGUIDs -Name $_.Name }# Enumerate any GPOs where we have access$gpoAcls | Where-Object {$_.IdentityReference -in @($username, $group)} | Select-Object @{Name = 'GPOName' ; Expression = {$gpos | Where-Object distinguishedname -eq $_.ObjectDN | Select-Object -Expand DisplayName}}, IdentityReference, AccessControlType, ActiveDirectoryRights