Windows ホストで PowerShell リモート機能を有効にしてテストする方法Issue <!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #7057C7; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: block; max-width: ; width: auto; height: auto; } } Windows 検出では PowerShell リモート機能を使用して、ターゲットデバイスでスクリプトを自動的に実行します。次の手順では、PowerShell リモート処理が有効で、各マシンで動作していることを確認します。 機能しない場合は、次のような一般的なエラーが表示されることがあります。 Failed to launch process powershell -ExecutionPolicy ByPass -NonInteractive -WindowStyle Hidden -command Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #7057C7; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: block; max-width: ; width: auto; height: auto; } } Madrid 3 以降のバージョン Resolution<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #7057C7; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: block; max-width: ; width: auto; height: auto; } } PowerShell リモート処理を有効にする サーバー上でリモート接続を行うには、次の操作を行います。 PowerShell を開き、 [管理者として実行] を選択します。 PowerShell ウィンドウで、コマンドレット Enable-PSRemoting -Force を入力します。Enter を選択します。 このコマンドは、WinRM サービスを開始し、システムで自動的に開始するように設定し、受信接続を許可するファイアウォールルールを作成します。コマンドレットの -Force の 部分は、各ステップの入力を求めることなく、これらのアクションを実行するように PowerShell に指示します。 リモート接続ホストを <trust zone> に追加します。 PowerShell を開き 管理者として実行 を選択します。PowerShell ウィンドウで、「 Set-Item wsman:\localhost\client\trustedhosts *」と入力します。 アスタリスクは、すべてのホストを示すワイルドカード記号です。接続できるサーバーを制限するには、アスタリスクを IP アドレスまたはホスト名のカンマ区切りリストに置き換えます。 WinRM サービスを再起動します。 PowerShell ウィンドウで、コマンドレット「 Restart-Service WinRM 」と入力します。Enter を選択します。 接続のテスト MID サーバーから、PowerShell で次のコマンドレットを実行します: Test-WsMan <Target IP>Enter を選択します。 このコマンドは、WinRM サービスがリモートホストで実行されているかどうかをテストします。 正常に完了すると、リモートホストのWinRMサービスに関する情報が表示され、WinRMが有効になっており<ターゲットホスト>が通信できることを示します。コマンドが失敗した場合は、代わりにエラーメッセージが表示されます。 リモートシステムで単一のリモートコマンドを実行する。 次のように Invoke-Command コマンドレットを使用します。 Invoke-Command -ComputerName COMPUTER -ScriptBlock { COMMAND } -credential USERNAME. 例 次のコマンドは、リモートホスト上の C:\ ディレクトリの内容を IP アドレスとユーザー名とともに表示します。 Invoke-Command -ComputerName <TargetIP> -ScriptBlock { Get-ChildItem C:\ } -credential domain\username リモート ホストで複数のコマンドレットを実行するには Invoke-Command コマンドレットとリモート IP アドレスを繰り返す代わりに、リモートセッションを開始します。以下にその手順を示します。 コマンドレット Enter-PSSession -ComputerName <Target IP> -Credential Domain\USER を入力します。Enter を選択します。 Related Links<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: #000000; } span { font-size: 12pt; font-family: Lato; color: #000000; } h2 { font-size: 24pt; font-family: Lato; color: black; } h3 { font-size: 18pt; font-family: Lato; color: black; } h4 { font-size: 14pt; font-family: Lato; color: black; } a { font-size: 12pt; font-family: Lato; color: #00718F; } a:hover { font-size: 12pt; color: #024F69; } a:target { font-size: 12pt; color: #032D42; } a:visited { font-size: 12pt; color: #7057C7; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: block; max-width: ; width: auto; height: auto; } } ディスカバリーの PowerShell リモート処理 MID Server PowerShell files (MID サーバーの PowerShell ファイル)