我正在尝试使用 powershell 从 Azure 网络上的一个 VM 远程连接到另一个 VM。
每台虚拟机都在自己的虚拟网络上,这些网络使用 VNET-to_VNET 连接双向连接。我还禁用了两台虚拟机的所有外部端口,这样它们就无法与外界连接。我正在使用点对点 VPN 通过 RDP 连接到它们,该 VPN 运行正常。
我已使用 powershell 将每个虚拟机添加到另一个虚拟机的受信任主机,并尝试使用以下命令进行连接
Enter-PSSession -ComputerName SERVERINTERNALIP -credential SERVERCREDENTIALNAME
这将返回以下错误:
Enter-PSSession : Connecting to remote server SERVERINTERNALIP failed with the following error message : WinRM cannot complete
the operation. Verify that the specified computer name is valid, that the computer is accessible over the network, and
that a firewall exception for the WinRM service is enabled and allows access from this computer. By default, the WinRM
firewall exception for public profiles limits access to remote computers within the same local subnet. For more
information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ Enter-PSSession -ComputerName SERVERINTERNALIP -credential SERVERCREDENTIALNAME
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (SERVERINTERNALIP:String) [Enter-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed