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: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } ターゲットホストで PowerShell リモート機能が有効になっていない場合に発生する Windows ディスカバリーエラーを解決します。Windows ディスカバリーは、PowerShell リモート機能を使用してターゲットデバイスでスクリプトを実行します。PowerShell リモート機能が有効になっていない場合、次のようなエラーが表示されることがあります。 「プロセスの起動に失敗しました 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: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Madrid リリース以降 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: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } PowerShell リモート機能を有効にする。 サーバーでリモート接続を有効にするには: PowerShell を開き、 アドミニストレーターとして実行を選択します。 PowerShell ウィンドウで、コマンドレットを入力します。Enable-PSRemoting -Force.Enter を選択します。 このコマンドは、WinRM サービスを開始し、システムで自動的に開始するように設定し、受信接続を許可するファイアウォールルールを作成します。-Force パラメーターは、各ステップの指示を表示せずにこれらのアクションを実行するように PowerShell に指示します。 リモート接続されたホストホストを信頼できるホストリストに追加します。 PowerShell を開き、 アドミニストレーターとして実行を選択します。PowerShell ウィンドウで、次のコマンドレットを入力します。Set-Item wsman:\localhost\client\trustedhosts * アスタリスクは、すべてのホストを示すワイルドカード記号です。接続できるサーバーを制限するには、アスタリスクを IP アドレスまたはホスト名のカンマ区切りリストに置き換えます。 WinRM サービスを再起動します。 PowerShell ウィンドウで、次のコマンドレットを入力します。Restart-Service WinRMEnter を選択します。 接続のテスト MID サーバーから PowerShell を開き、次のコマンドレットを実行します。test-wsMan <ターゲット IP>Enter を選択します。 このコマンドは、WinRM サービスがリモートホストで実行されているかどうかをテストします。 正常に完了すると、リモートホストの WinRM サービスに関する情報が表示されます。これは、WinRM が有効であり、ターゲットホストが通信できることを示します。コマンドが失敗した場合は、代わりにエラーメッセージが表示されます。 リモートシステムで単一のリモートコマンドを実行します。 次のように Invoke-Command コマンドレットを使用します。 Invoke-Command -ComputerName COMPUTER -ScriptBlock { COMMAND } -credential USERNAME. 例 次のコマンドは、指定した IP アドレスとユーザー名を持つリモートホスト上の C:\ ディレクトリの内容を表示します。 Invoke-Command -ComputerName <TargetIP> -ScriptBlock { Get-ChildItem C:\ } -認証情報ドメイン\ユーザー名 リモートホストで複数のコマンドレットを実行する。 Invoke-Command コマンドレットとリモート IP アドレスを繰り返す代わりに、リモートセッションを開始します。 次のコマンドレットを入力します。Enter-PSSession -ComputerName <Target IP> -Credential Domain\USEREnter を選択します。 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: #00718f; } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } ディスカバリー用 PowerShell リモート機能 MID Server PowerShell files (MID サーバーの PowerShell ファイル)