I\'m trying to get ALL the groups a user is member, even the nested ones (recusively), in Powershell I\'m using:
(Get-ADUser -Properties Mem
Or, you can use the constructed attribute tokenGroups and a base-scoped query:
$tokenGroups = Get-ADUser -SearchScope Base -SearchBase '' ` -LDAPFilter '(objectClass=user)' -Properties tokenGroups | Select-Object ` -ExpandProperty tokenGroups | Select-Object -ExpandProperty Value