How to get all groups that a user is a member of?
active-directory, cmd, powershell, powershell-2.0, windows
Solution
`Get-ADPrincipalGroupMembership` from the Active Directory module will do this. You'll need that module, or RSAT on Windows 10+, installed to run the command below.
Get-ADPrincipalGroupMembership username | select name
name
----
Domain Users
Domain Computers
Workstation Admins
Company Users
Company Developers
AutomatedProcessingTeam
Problem
PowerShell's `Get-ADGroupMember` cmdlet returns members of a specific group. Is there a cmdlet or property to get all the groups that a particular user is a member of?