windows 如何使用windows cmd查看用户权限?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11607389/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to view user privileges using windows cmd?
提问by AJINKYA
I am trying to view the user privileges using the command prompt in Windows. User account & User privileges such as:
我正在尝试使用 Windows 中的命令提示符查看用户权限。用户帐户和用户权限,例如:
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.
我尝试使用ntrights
但它不起作用。我无法使用任何工具,因为我正在尝试为操作系统审计创建自动脚本。
采纳答案by Simon Catlin
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.
然后检查相关权限的行。但是,现在的问题是帐户被列为 SID,而不是用户名。
回答by rfb
You can use the following commands:
您可以使用以下命令:
whoami /priv
whoami /all
For more information, check whoami @ technet.
有关更多信息,请查看whoami @ technet。
回答by twasbrillig
Mark Russinovich wrote a terrific tool called AccessChk that lets you get this information from the command line. No installation is necessary.
Mark Russinovich 编写了一个名为 AccessChk 的出色工具,可以让您从命令行获取此信息。无需安装。
http://technet.microsoft.com/en-us/sysinternals/bb664922.aspx
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
.
相比之下,whoami /priv
和whoami /all
失踪给我一些项目,像SeServiceLogonRight
。
回答by Vamsi Pradeep Elicherla
Go to command prompt and enter the command,
转到命令提示符并输入命令,
net user <username>
Will show your local group memberships.
将显示您的本地组成员身份。
If you're on a domain, use localgroupinstead:
如果您在域中,请改用localgroup:
net localgroup Administrators or net localgroup [Admin group name]
Check the list of local groups with localgroup on its own.
使用 localgroup 自行检查本地组列表。
net localgroup
回答by Nimisha
Use whoami /priv
command to list all the user privileges.
使用whoami /priv
命令列出所有用户权限。
回答by Vamsi Pradeep Elicherla
For Windows Server? 2008, Windows 7, Windows Server 2003, Windows Vista?, or Windows XP run "control userpasswords2"
对于 Windows 服务器?2008、Windows 7、Windows Server 2003、Windows Vista? 或 Windows XP 运行“控制用户密码2”
Click the Start button, then click Run (Windows XP, Server 2003 or below)
Type control userpasswords2 and press Enter on your keyboard.
单击开始按钮,然后单击运行(Windows XP、Server 2003 或更低版本)
键入 control userpasswords2 并按键盘上的 Enter。
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.
注意:对于 Windows 7 和 Windows Vista,此命令不会通过在“开始”菜单的“搜索”框中键入来运行 - 它必须使用“运行”选项运行。要将运行命令添加到开始菜单,请右键单击它并选择自定义选项,然后转到高级选项。选中以添加运行命令的选项。
You will see a window of user details!
您将看到一个用户详细信息窗口!