====== PowerShell リモートコマンド実行 ====== ===== PSRemoting の有効化 ===== $ sudo Enable-PSRemoting -SkipNetworkProfileCheck WARNING: PowerShell remoting has been enabled only for PowerShell 6+ configurations and does not affect Windows PowerShell remoting configurations. Run this cmdlet in Windows PowerShell to affect all PowerShell remoting configurations. WinRM サービスの種類を正しく変更できました。 WinRM サービスが開始されました。 WinRM ファイアウォールの例外を有効にしました。 ローカル ユーザーにリモートで管理権限を付与するよう LocalAccountTokenFilterPolicy を構成しました。 WARNING: Waiting for service 'Windows Remote Management (WS-Management) (WinRM)' to stop... $ sudo Set-Item WSMan:\localhost\Client\TrustedHosts -Value * WinRM Security Configuration. This command modifies the TrustedHosts list for the WinRM client. The computers in the TrustedHosts list might not be authenticated. The client might send credential information to these computers. Are you sure that you want to modify this list? [Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y ===== 参考文献 ===== [[https://docs.microsoft.com/ja-jp/powershell/scripting/learn/remoting/running-remote-commands?view=powershell-7|リモート コマンドの実行 - PowerShell | Microsoft Docs]]\\ [[https://blog.ipswitch.com/jp/how-to-run-commands-on-remote-computers-with-powershell|PowerShell を使ってリモートコンピュータでコマンドを実行する方法]]\\ **PowerShell Remoting**\\ [[https://ascii.jp/elem/000/001/694/1694500/|ASCII.jp:PowerShell Remotingで自宅にあるたくさんのWindowsマシンを管理する]]\\