Is there a way (in Windows) to delineate the roles my login has on the box I'm logged in to?

The machine is joined to a domain, if that makes a difference.

  • What roles?? Like the groups you're a member of?
    – Chris S
    Oct 14 '10 at 17:27
  • Say my account is a member of Remote Desktop Users because of a domain group I'm a part of that was added as a member of that group on the local box - I'd like to see that I'm a member of that group. I'd be fine with either groups or permissions, I guess.
    – Matt Mills
    Oct 14 '10 at 17:32

If you are ready to do some coding, you can use following commands to get the information you want. When executed separately these commands give the information in bits and pieces.

C:\>net localgroup

This will give list of all local groups. Iterate on this list and execute

C:\>net localgroup <groupName>

This will give list of all members (users and groups which are added to this local group).

To get the list of all domain groups, you are part of, you can execute

C:\>net user <username> /domain

Look for Global Group memberships in the output. PS: /domain is a keyword. Don't replace it with your domain name.

Now if your user name or the Global Groups are part of the members list of any local group (output of second command), then it is the role assigned to you.

Unfortunately, these commands output more data / text than what you want. So you will need to write some code (in your favorite language or even .bat file) to parse and combine the output of above commands.

It will be worth writing a program if you repeatedly need to find roles of a user.

  • Glad I could help. Btw, if you have written a program to combine the output of these commands, can you please share it somewhere. Oct 23 '10 at 11:30

You can use LG from joeware to do more than you would be able to do with "net localgroup", which only lists the groups that are on your machine. This should give you the direction you need.

It's a simple command line app: you can download it here link

This command will list the members of all the localgroups...

lg \\localhost -lu

You may want to look into powershell to write something that just pulls your groups in a more specific fashion.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.