Get groups in which a user is a member via Windows Power-Shell

Sometimes, you might need to get the Active Directory groups in which a user is a member specifically if you didn’t have access permission to Active Directory server where you don’t have a GUI to go to user properties and checks the “Member Of” tab.

User Properties - Member Of.png

In this case, so you only have an option to to get the Active Directory groups in which a user is a member via command line. by following the mentioned steps below:

Steps:

  • Run Command Prompt / Windows Power-Shell as administrator.

Run CMD As Administrator

  • Run the following command.
    • net user /domain username
  • In my scenario, I need to know if the “spepmfarm” belong to “epmsys” group or not.
    • net user /domain spepmfarm
  • Check Global Group Membership line to find all groups in which “spepmfarm” is amember.
    • You could also find other useful details like (last login ,last password set and more).

net user command

Enjoy 🙂

Advertisements

One thought on “Get groups in which a user is a member via Windows Power-Shell

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s