How to get all groups that a user is a member of?

Primoz picture Primoz · Feb 22, 2011 · Viewed 1M times · Source

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?


I fixed my mistake: Get-Member should be Get-ADGroupMember.

Answer

kstrauss picture kstrauss · Mar 22, 2013

Get-ADPrincipalGroupMembership will do this.

Get-ADPrincipalGroupMembership username | select name

name
----
Domain Users
Domain Computers
Workstation Admins
Company Users
Company Developers
AutomatedProcessingTeam