How to verify my current user has admin rights or not? [duplicate]

Solution 1:

Start -> Run -> cmd.exe

net user <username>

Will show your local group memberships at the bottom of the output so its easy to find. This is probably a lot faster than bumbling through a GUI to look for options (win+R,cmd,enter, no mouse involved).

If you're on a domain, use localgroup instead:

net localgroup Administrators

Check the list of local groups with localgroup on its own.

net localgroup

Solution 2:

Another very simple way on XP is to right-click on the clock in the tray and select the Adjust Date/Time command. You get a message if you don't have admin rights.

Solution 3:

There is a very easy way to check if the current user has local admin rights in xp:

  1. right click on start
  2. check if you have the option to "open all users"
  3. if it's there, you have admin rights

Solution 4:

If you add the /domain switch to the net command it will run the command at the domain level. That should help those that are looking to run the command on those types of groups and users.

It works from non-admin users. I tested it.

It automatically uses the domain that the computer is a member of. Global Group membership is actually domain group membership.

Using netcommand/help gives very detailed descriptions of the switches. That is how I found out about the switch. If you just use /?, you will only get basic syntax help.

Solution 5:

that is not universal methode cause such script fails in case of other system language. e.g.: in russian language we have not Administrators but Администраторы (yes, i agree that is absolutly stupid but that is so in microsoft).

there is one more variant for cmd:

if not exist "%logonserver%\admin$\*.*" goto common_user

but experiments show it is not universal too, e.g.: the first administrator logon to system after windows setup (and possibly in many other cases like disabled admin shares via system registry and so on).