Active directory: How to find all memberships for specific user

There are three ways, using net, dsquery or whoami command from command prompt.
net user /domain username
Problem with net command is that output group names are truncated on 21 character, but with this command you can see more usefull informations.

dsquery user -samid “username” | dsget user -memberof -expand – with full group description
dsquery user -samid username | dsget user -memberof | dsget group -samid – group names are much more clear
dsquery user -samiduser id| dsget user -memberof > filename.txt – create txt file with membership list

whoami / groups – with this command you can get list only for current user / token.

 

Usefull links

Active Directory: DSQUERY Commands
whoami