2016-12-07 6 views
0

ワークグループ内に複数のマシンがあります。それぞれは、同じ管理者ユーザとパスワードを持っていると私はそれらのすべてこれを行い、スクリプトの 一部にパスワードを変更する必要がある:ワークグループ内のローカル管理者のパスワードを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.

Iこの試みた:How to Run PowerShell Commands on Remote Computers が、それは

を助けていませんが、質問は、私はこれを許可するようにファイアウォールにどのようなルール必要ですされ ...私はオフリモートマシン上でファイアウォールを回し、その後、それが働いていましたか?私はそれがどちらかリモート管理とリモート資格がAdministratorsグループ(の一部であることに加えて有効にするルールを共有ファイル&印刷の両方を必要と信じているポート/プロトコル

+0

私はあなただけで[有効-PSRemoting](https://msdn.microsoft.com/en-us/powershell/reference/5.1/microsoft.powershell.core/enableする必要があると思います-psremoting)を実行します。 –

答えて

0

を見つけ出すことができませんでした明示的にまたはドメイングループ経由で)

次のWebサイトは、ドメインのグループポリシーでこの機能を有効にする方法を示しています。コンピュータ管理とPowershellの両方のセクションが必要です。

https://4sysops.com/archives/add-a-user-to-the-local-administrators-group-on-a-remote-computer/

... [Computer Management] Hence, if you want to manage remote computers with Computer Management, you have to enable the Group Policy setting Allow inbound remote administration exception for the Windows Firewall. You can find the policy in Computer Configuration > Administrative Templates > Network > Network Connections > Windows Firewall > Domain Profile.

Allow inbound remote administration exception

... [Powershell] For this method to work, we need another firewall setting as with the Computer Management solution. You have to enable the Group Policy Allow inbound file and printer sharing exception. The policy is also located in Computer Configuration > Administrative Templates > Network > Network Connections > Windows Firewall > Domain Profile.

Allow inbound file and printer sharing exception

+0

ありがとう! GPOでの受信リモート管理例外を許可しました –

関連する問題