用于获取用户信息的 Windows 批处理命令

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12777081/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 15:55:41  来源:igfitidea点击:

Windows batch commands to get user info

windowsbatch-file

提问by Ivaylo Strandjev

I want to retrieve user information using batch. What I need is information for the groups the user belongs to and for the security settings for this user. I was not able to find any commands that would help me to achieve that. Any help will be appreciated.

我想使用批处理来检索用户信息。我需要的是用户所属组的信息以及该用户的安全设置。我找不到任何可以帮助我实现这一目标的命令。任何帮助将不胜感激。

回答by gammay

You can parse outputs from net user /domain <user>or gpresult /rcommands.

您可以解析来自net user /domain <user>gpresult /r命令的输出。