How can I find all groups a user belongs to via DSQUERY

How can I find all groups for a specific user (groups for which the user is assigned) using dsquery?


Solution 1:

dsquery user -samid [username] | dsget user -memberof -expand | dsget group -samid

Good Luck!