我在我的 Server 2008 R2 上成功启用了 PSRemoting。我可以使用主机名作为目标从同一网络中执行远程 pssession。
当我尝试从任何计算机(在网络内或从另一个网络(例如通过 VPN))使用 IP 地址作为目标时,我失败了。我希望能够通过我的 VPN 连接使用远程处理,因为无法解析主机名,所以我必须使用 IP 地址。
我不想将名称添加到我的主机文件中,因为我们客户端的其他一些服务器具有相同的 dns 名称,我不想删除并再次插入名称 IP 地址关联然后再次。
我希望有人能告诉我如何允许通过 IP 调用 psremoting-target。
编辑:更具体地说,我希望能够运行这个:
Enter-PSSession -Computername 192.168.123.123 -credentials $cred
-Computername
但是,如果我将主机名传递给“ ” ,我只能运行该命令
Edit2:
当我尝试使用 ip 而不是主机名(来自内部网络)登录时,我收到以下错误消息:
Enter-PSSession : Connecting to remote server failed with the following error message : The WinRM client cannot process
the request. Default authentication may be used with an IP address under the following conditions: the transport is HT
TPS or the destination is in the TrustedHosts list, and explicit credentials are provided. Use winrm.cmd to configure T
rustedHosts. Note that computers in the TrustedHosts list might not be authenticated. For more information on how to se
t TrustedHosts run the following command: winrm help config. For more information, see the about_Remote_Troubleshooting
Help topic.
Edit3:
我知道 WSMan 的可信主机设置,但这似乎不是问题。它已经设置为“*”(我在启用远程处理后立即这样做了),但我仍然无法使用 ip 作为目标计算机名连接到该服务器,但我可以使用主机名作为目标计算机名进行连接. 似乎 IIS 中的绑定之类的东西会阻止侦听器侦听针对 ip 号而不是主机名的请求。但是没有安装 IIS。我不知道在哪里寻找这样的设置。
2011-07-12 更新:
好的,我认为trustedhosts 设置不是问题,因为我可以通过主机名从我们的DC 连接,但如果我使用计算机参数的目标IP 地址则不能。
我想,问题一定是听者。也许侦听器不接受针对目标 IP 而不是目标主机名的请求。但我不知道如何改变它。