私はリソースマネージャーにVMを持っており、これらのVMをrunbookからリモートPowerShellスクリプトを実行したいと思っています。私はすでに古典的なバーチャルマシンでそれを行い、成功する方法を知っています。リソースマネージャからPSSession VMを取得する方法
Azure Resource Managerで作成されたAzure VMでは、デフォルトで証明書が有効になっているリモートPowerShell over SSLが使用されていますか? Enter-PSSessionまたはInvoke-Commandとの接続方法を教えてください。
私はこのコードを無事に試しました。
Enter-PSSession -ComputerName <public-IP> -Credential $cred -SessionOption (New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck)
そして、私はこのエラー
Enter-PSSession : Connecting to remote server <public-IP> failed with the following error message : The WinRM client
cannot process the request. If the authentication scheme is different from Kerberos, or if the client computer is not
joined to a domain, then HTTPS transport must be used or the destination machine must be added to the TrustedHosts
configuration setting. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not
be authenticated. You can get more information about that by running the following command: winrm help config. For more
information, see the about_Remote_Troubleshooting Help topic.
注ました:私はAzureのオートメーションでPowerShellのRunbookのでこれを実行していることを。 here
VMリモートPowerShellをHTTPSで設定して、やり直してください。 'Transport = HTTPS'と' Port = 5986'が必要です。 –
@JackZeng既に= '(ただし、まだリモーティングに成功していません。 –