Tuesday, February 4, 2014

How to find group membership of a user on Active Directory

Hello People,

If you wish to find the groups, related to any user Active Directory profile, You can of course use GUI and check the groups on ADCU (Active Directory Users & Computers).

However there is another way, using command line tool, you need to be a part of Domain Administrator & logon to Domain Controller to perform & find the results of below command
  1.  Please open CMD - command prompt
  2. Type - dsquery user -samid (userid) | dsget user -memberof
  3. Typing - dsquery user -samid (bhandyal) | dsget user -memberof  >> abc.txt - Will save text file on your root drive.

I've tested this on many of my DCs & found successful results.
Please ensure, that the above command is space sensitive, If not working for you, Please ensure, you are entering correct space.


Happy to help