Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to view user privileges using windows cmd?

I am trying to view the user privileges using the command prompt in Windows. User account & User privileges such as:

SeBatchLogonRight SeDenyBatchLogonRight SeInteractiveLogonRight SeDenyInteractiveLogonRight SeServiceLogonRight SeDenyServiceLogonRight SeNetworkLogonRight SeDenyNetworkLogonRight 

I tried using ntrights but it's not working. I can't use any tool as I am trying to create an automated script for an OS audit.

like image 445
AJINKYA Avatar asked Jul 23 '12 06:07

AJINKYA


People also ask

How can I see user privileges in cmd?

Open the Command Prompt by using the search bar and type: net user (account name). So the entry would look like this: net user fake123. If in the Local Group Memberships section, you only see Users, then you have a standard user account.

How do I get administrative privileges in cmd?

Type cmd, right-click the Command Prompt tile, and then click Run as administrator.


2 Answers

You can use the following commands:

whoami /priv whoami /all 

For more information, check whoami @ technet.

like image 173
rfb Avatar answered Sep 28 '22 05:09

rfb


Mark Russinovich wrote a terrific tool called AccessChk that lets you get this information from the command line. No installation is necessary.

http://technet.microsoft.com/en-us/sysinternals/bb664922.aspx

For example:

accesschk.exe /accepteula -q -a SeServiceLogonRight 

Returns this for me:

IIS APPPOOL\DefaultAppPool IIS APPPOOL\Classic .NET AppPool NT SERVICE\ALL SERVICES 

By contrast, whoami /priv and whoami /all were missing some entries for me, like SeServiceLogonRight.

like image 31
twasbrillig Avatar answered Sep 28 '22 07:09

twasbrillig