Windows 使用winrm连接到远程服务器,而不将服务器添加到TrustedHosts

Windows 使用winrm连接到远程服务器,而不将服务器添加到TrustedHosts,windows,windows-7,windows-server-2008,winrm,remote-management,Windows,Windows 7,Windows Server 2008,Winrm,Remote Management,我一直在努力与winrm和TrustedHosts打交道,但都无济于事。经过一些实验,我发现winrm/config/client的this字段最多限制为1023个符号,这是远远不够的,特别是如果通过ipv6添加主机。 我引自:当无法建立相互身份验证时,应设置受信任主机列表。 同样,在同一个文件中,文本说:工作组中的其他计算机或不同域中的计算机应添加到此列表。因此,我认为这意味着,只要两台计算机位于同一域中,我就应该能够使用winrm从另一台计算机访问其中一台计算机 我尝试将两台计算机添加到测试

我一直在努力与winrm和TrustedHosts打交道,但都无济于事。经过一些实验,我发现winrm/config/client的this字段最多限制为1023个符号,这是远远不够的,特别是如果通过ipv6添加主机。 我引自:
当无法建立相互身份验证时,应设置受信任主机列表。

同样,在同一个文件中,文本说:
工作组中的其他计算机或不同域中的计算机应添加到此列表。
因此,我认为这意味着,只要两台计算机位于同一域中,我就应该能够使用winrm从另一台计算机访问其中一台计算机

我尝试将两台计算机添加到测试域,并执行了以下操作:

winrm get winrm/config/client-r:192.168.100.1-u:user-p:pass

从一个连接到另一个,但此操作失败,出现错误:

WSManFault
    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 ad
ded to the TrustedHosts configuration setting. Use winrm.cmd to configure Truste
dHosts. You can get more information about that by running the following command
: winrm help config.

Error number:  -2144108316 0x803380E4
The WinRM client cannot process the request. If the authentication scheme is dif
ferent 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 Tru
stedHosts configuration setting. Use winrm.cmd to configure TrustedHosts. You ca
n get more information about that by running the following command: winrm help c
onfig.

将192.168.100.1添加到TrustedHosts后,上述查询成功。所以我的问题是:是否可以在两台主机之间使用winrm而不修改TrustedHosts?将受信任主机设置为
*
对我来说不是一个选项。

如果两台计算机位于同一个域上,您应该能够使用计算机名而不是IP地址。据我所见,当您使用IP地址时,您几乎被迫使用TrustedHosts。

很抱歉延迟。这可能很有趣,但我在网上找不到任何地方提到,如果你使用ComputerName,你不需要向TrustedHosts添加任何内容。但我验证了它的有效性:)