windows - 是否有用于将用户添加到高级用户组的批处理脚本?

标签 windows batch-file windows-xp

我正在尝试创建一个脚本,该脚本将在我们安装的新系统上创建新用户帐户并将它们放入相应的权限组中。我已经设法将用户添加到“管理员”组并将他们从“用户”组中删除,但是在将用户添加到“高级用户”和“远程桌面用户”组时我遇到了一些麻烦。到目前为止的脚本如下:

net user User1 User1 /add

net user User2 User2 /add 

net localgroup administrators User2 /add

net localgroup powerusers User1 /add

net localgroup users Users2 /delete

除脚本第 4 行外的所有内容都执行良好我已尝试使用以下行来替换第 4 行但没有运气,行如下:

net localgroup power_users user1 /add

net localgroup power%20%users user1 /add

如有任何帮助,我们将不胜感激。

最佳答案

网络本地组

列出机器中的可用组..检查组是否存在,然后继续添加。

如果该组存在但您仍然有问题,请尝试“Power Users”。

关于windows - 是否有用于将用户添加到高级用户组的批处理脚本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13416422/

相关文章:

windows-7 - 记录 windows 关机顺序操作

windows-7 - VB6 Timer()、Space() Form_Initialize() 导致立即崩溃

windows - 通过组策略添加管理员

c - 使用C语言注入(inject)dll

batch-file - cmd.exe 批处理文件中意外处理 "variables"

windows - 在 Windows 上创建桌面链接的脚本?

python - 使用 Python 获取 Windows 系统内部信息

php - 不能使用命令行解释器

windows - 从 Git Bash 运行 Ruby 时出现 "Bad Interpreter: No Medium"错误

batch-file - 批处理脚本 : Using GOTO on IF statement