【发布时间】:2011-09-29 01:38:00
【问题描述】:
我在我的 Server 2008 R2 上成功启用了 PSRemoting。 我可以在同一网络中使用主机名作为目标进行远程 pssession。
当我尝试从任何计算机(在网络内或从另一个网络(例如通过 VPN))使用 IP 地址作为目标时,我失败了。 我希望能够通过我的 VPN 连接使用远程处理,因为无法解析主机名,因此我必须使用 IP 地址。
我不想将名称添加到我的主机文件中,因为我们客户端的其他一些服务器具有相同的 dns 名称,我不想删除并插入名称 IP 地址- 一次又一次的联想。
希望有人能告诉我如何允许通过IP调用psremoting-target。
编辑:更具体地说,我希望能够运行这个:
Enter-PSSession -Computername 192.168.123.123 -credentials $cred
但是,如果我将主机名传递给“-Computername”,我只能运行该命令
编辑2:
当我尝试使用 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.
编辑3:
我知道 WSMan 的可信主机设置,但这似乎不是问题。它已经设置为“*”(我在启用远程处理后立即这样做了),但我仍然无法使用 ip 作为目标计算机名连接到该服务器,但我可以使用主机名作为目标计算机名进行连接.似乎 IIS 中的绑定之类的东西会阻止侦听器侦听针对 IP 号而不是主机名的请求。但是没有安装 IIS。我不知道在哪里可以找到这样的设置。
2011-07-12 更新:
好的,我认为trustedhosts 设置不是问题,因为我可以通过主机名从我们的DC 连接,但如果我使用计算机参数的目标IP 地址则不是。
我想,问题一定是听者。也许侦听器不接受针对目标 IP 而不是目标主机名的请求。但我不知道如何改变它。
【问题讨论】:
-
Enable-PSRemoting没有-ComputerName参数。你的意思是Enter-PSSession? -
呃,是的。我很困惑 :) 我会编辑它。
-
尝试命令时收到的错误信息是什么?
标签: powershell remoting powershell-remoting