我的工作組中有多臺機器。每個人都有相同的管理員用戶名和密碼,我需要在所有這些 腳本,這是否是該部分的更改密碼:通過PowerShell遠程更改工作組中本地管理員的密碼
$user = [adsi]"WinNT://$computer/$username"
$user.SetPassword($password)
$user.SetInfo()
我得到這個錯誤:
The following exception occurred while retrieving member "SetPassword": "The network path was not found.
我嘗試這樣:How to Run PowerShell Commands on Remote Computers ,但它並不能幫助
我打開防火牆的遠程機器關閉,然後它的工作... 問題是,我需要在防火牆規則是什麼,讓這個?我想不出我相信哪個端口/協議
我想你只需要爲[Enable-PSRemoting(https://msdn.microsoft.com/en-us/powershell/reference/5.1/microsoft.powershell.core/enable -psremoting)在遠程機器上。 –