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

时间:2015-02-13 06:53:38

标签: shell window-server

ntdsutil"设置dsrm密码" "重置服务器%1" "新密码" "新密码" q q

我试过但仍然是手动询问密码请提供一些脚本,以便在提示时自动输入密码

1 个答案:

答案 0 :(得分:1)



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}":