Enumerate user memberships with Powershell

Enumerating user memberships is a common task to perform.  Unlike other scripting languages, with Powershell it’s a one-line action.

First download/install Quest AD Tools, and add them:

add-pssnapin quest.activeroles.admanagement

I use a semicolon to combine two Powershell commands:

$sUser = get-qaduser -samaccountname <username>; $sUser.MemberOf

get-qaduser memberof

get-qaduser memberof

Enumerate security group user memberships with PowerShell by using get-QADGroupMember

First download and install ActiveRoles Management Shell for Active Directory.

add-pssnapin quest.activeroles.admanagement

get-qadgroupmember “group name”

image

 

Bring in some formatting by using the ‘select’ parameter:

get-qadgroupmember “group name” | select logonname, displayname

image