shell 需要在多个W2K3 DC上更改DSRM密码(自动),而无需手动输入密码

hs1rzwqc  于 2022-11-16  发布在  Shell
关注(0)|答案(1)|浏览(60)
ntdsutil "set dsrm password" "reset password on server %1" "newpassword" "newpassword" q q

我已经尝试了,但它仍然是手动询问密码,请提供我一些脚本,输入密码时,它会自动提示。

p5fdfcr1

p5fdfcr11#

Set WshShell = WScript.CreateObject("WScript.Shell"):
  WshShell.Run "cmd", 9:
  WScript.Sleep 500:
  WshShell.SendKeys " ntdsutil ":
  WshShell.SendKeys "{ENTER}":
  WshShell.SendKeys "{set dsrm password}":
  WshShell.SendKeys "{ENTER}":
  WshShell.SendKeys "{sync from domain account Admin}":
  WshShell.SendKeys "{ENTER}":
  WshShell.SendKeys "Hello World!":
  WshShell.SendKeys "{ENTER}":
  WScript.Sleep(2000):
  WshShell.SendKeys "Hello World!":
  WshShell.SendKeys "{ENTER}":

相关问题