我在资源管理器中有虚拟机,我想从这些虚拟机的Runbook中执行远程PowerShell脚本。我已经知道如何在经典的虚拟机中做到这一点,并成功地使用它。如何从资源管理器PSSession VM?
现在,基于SSL的远程PowerShell是否具有默认情况下在使用Azure资源管理器创建的Azure虚拟机上启用的证书?我如何连接到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.
注意:我使用PowerShell运行手册在Azure中运行自动化此。 并尝试了建议的答案here
使用HTTPS配置VM远程PowerShell,然后重试。你应该有'Transport = HTTPS'和'Port = 5986'。 –
@JackZeng已经完成了='(但仍然没有成功的远程处理 –