我在不同的位置有4或5个DC,我想编写一个Powershell脚本,可以将密码重置为所有DC上的用户帐户,这样他们就不必等待复制,或者我不会#39 ; t必须到最近的DC为他们重置它。
答案 0 :(得分:0)
Set-ADAccountPassword命令有一个Server
参数,您可以在其中告诉它使用哪个域控制器。
您可以使用以下方法之一获取域中的DC列表:http://use-powershell.blogspot.ca/2013/04/find-all-domain-controllers-in-domain.html
循环显示DC列表,并为每个DC调用Set-ADAccountPassword
。