How Can I tell if the current user is Admin from Windows Command Line

9

Is there anything I can call from the command line which will tell me if the currently logged in user has a limited account or is an admin?

Adam Dempsey

Posted 2010-09-23T16:15:15.587

Reputation: 255

Answers

11

With the default command tools (no third party downloads) you can use the net command.

%username% will have the username of the current logged on user, so I would use:

net user "%username%"

To display information about the current logged on user. The last section of this shows:

Local Group Memberships      *Administrators       *HelpLibraryUpdaters
                             *HomeUsers
Global Group memberships     *None

Hope this helps

William Hilsum

Posted 2010-09-23T16:15:15.587

Reputation: 111 572

1Don't forget to add the domain first if your in a domain – r0ca – 2010-09-23T16:31:31.417

1If you're on a domain, you can just append the command above with "/DOMAIN". I.e., net user "%USERNAME%" /DOMAIN – cowlinator – 2018-04-04T20:30:46.223

1

What I do most of the time is in the command prompt:

compmgmt.msc /computer=Computer_name

Then, I check in the user/admin groups

You can also check with the PSTools. There is a lot you can do remotely within a domain with this!

r0ca

Posted 2010-09-23T16:15:15.587

Reputation: 5 474