Get-Process がリモート Windows 7 クライアントに対して機能しない

Get-Process がリモート Windows 7 クライアントに対して機能しない

私はマイクロソフトのGetNetworkStatistics スクリプトリモート コンピュータに対して、他のツールとともに、どのプロセスが帯域幅を使用しているかを追跡できるようにします。

リモートの Windows 7 クライアントに対してスクリプトを実行できません。リモートとローカルの両方で Windows Server 2012 r2 マシンに対して実行すると正常に動作します。また、Windows 7 マシン上でローカルに実行した場合も正常に動作します。

Windows 7 クライアントで Enable-PSRemoting を実行し、Windows ファイアウォールで Windows リモート管理と Windows Management Instrumentation を許可しました。

これはリモートのWindows 7マシンに対して実行するときに発生するエラーです

WARNING: Could not run Get-Process -computername win7.  Verify permissions and connectivity.  Defaulting to no
ShowProcessNames
'C:\netstat.txt' on win7 converted to '\\win7\C$\netstat.txt'.  This path is not accessible from your system.
At C:\Users\user\Desktop\Get-NetworkStatistics.ps1:200 char:25
+                         Throw "'$tempFile' on $computername converted to '$remot ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: ('C:\netstat.txt...om your system.:String) [], RuntimeException
    + FullyQualifiedErrorId : 'C:\netstat.txt' on win7 converted to '\\win7\C$\netstat.txt'.  This path is not accessi
   ble from your system.

リモート Windows 7 クライアントに対して get-process のみを実行しようとしましたが、ローカルでは動作しますが、リモートでは動作しません (Windows Server 2012 r2 に対してはリモートでもローカルでも動作します)。

私も実行しましたInvoke-Command {get-process} -computername $machinename -credential $domain\admin。正しい資格情報を提供した後でも同じ結果が得られます。

ご協力いただければ幸いです。

答え1

リモート システムで WinRM が実行されていることを確認してください。表示されたエラーから判断すると、実行されていないようです。ファイアウォールの設定も確認してください。

Windows リモート管理

システムがドメインの一部である場合は、PowerShell を使用してリモートで管理するマシンに対して自動的にオンになるようにグループ ポリシーを設定できます。

Windows サーバーのみ、これがデフォルトでオンになっています。Windows クライアントでは、これがデフォルトでオフになっています。

関連情報