问题
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.....etc.
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.
Thanks in advance.
回答1:
I'd start with secedit /export /areas USER_RIGHTS /cfg OUTFILE.CFG. Then examine the line for the relevant privilege. However, the problem now is that the accounts are listed as SIDs, not usernames.
回答2:
you can use whoami /priv
or whoami /all
see whoami @ technet
回答3:
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
.
回答4:
Go to command prompt and enter the command,
net user <username>
Will show your local group memberships.
If you're on a domain, use localgroup instead:
net localgroup Administrators or net localgroup [Admin group name]
Check the list of local groups with localgroup on its own.
net localgroup
回答5:
Use whoami /priv
command to list all the user privileges.
回答6:
For Windows Server® 2008, Windows 7, Windows Server 2003, Windows Vista®, or Windows XP run "control userpasswords2"
Click the Start button, then click Run (Windows XP, Server 2003 or below)
Type control userpasswords2 and press Enter on your keyboard.
Note: For Windows 7 and Windows Vista, this command will not run by typing it in the Serach box on the Start Menu - it must be run using the Run option. To add the Run command to your Start menu, right-click on it and choose the option to customize it, then go to the Advanced options. Check to option to add the Run command.
You will see a window of user details!
来源:https://stackoverflow.com/questions/11607389/how-to-view-user-privileges-using-windows-cmd