【发布时间】:2014-02-04 19:49:53
【问题描述】:
我在 Windows Azure 中创建了一个新 VM,用作主机来学习一点 Powershell Remoting。创建虚拟机后,我将 RDP'd 放到盒子上并通过以下命令启用远程处理:
Enable-PSRemoting
我用“a”回复确认了两个提示,并且它没有错误地完成。如果我跑
Get-PSSessionConfiguration
我可以看到已经设置了三个端点 (?)。在 Azure 门户中,我可以看到 Powershell 端口是开放的 - 5986 都作为公共和私有端口开放。
我已将机器的公共 IP 地址添加到我的 hosts 文件中,但是当我尝试以下操作时:
Enter-PSSession -ComputerName AZURESERVERNAME
我收到一个错误:
Enter-PSSession:连接到远程服务器 AZURESERVERNAME 失败 带有以下错误消息:指定的登录会话没有 存在。它可能已经被终止。有关详细信息,请参阅 about_Remote_Troubleshooting 帮助主题。在行:1 字符:1 + Enter-PSSession -ComputerName AZURESERVERNAME + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (AZURESERVERNAME:String) [Enter-PSSession], PSRemotingTransportException + FullyQualifiedErrorId : CreateRemoteRunspaceFailed
我还尝试将所有主机设置为已信任,如下所示:
cd wsman::localhost\client
Set-Item .\TrustedHosts *
Restart-Service WinRM
但这似乎也没有帮助。
我还需要做些什么来让它工作吗?
谢谢
【问题讨论】:
标签: powershell azure powershell-remoting