我在本地和远程机器上使用命令提示符测试WinRM连接,我的问题分为两部分。在PowerShell中使用WinRM成功配置和侦听
PART我
我用ping命令测试坪TCP/IP连接:本地计算机和远程计算机,默认网关和DNS服务器的IP地址和它完美地运行在本地和远程计算机上。
但使用WinRM的命令进行测试时,我用这个命令来查找听众和地址
winrm e winrm/config/listener
它给了我这个输出为我的本地机器
Listener
Address = *
Transport = HTTP
Port = 5985
Hostname
Enabled = true
URLPrefix = wsman
CertificateThumbprint
ListeningOn =<IP Address>,127.0.0.1, ::1,fe80::100:7f:fffe%13,fe80::803:5e43:50ef:c50%11
但同样的命令,当我运行在远程机器给我一个输出与其他一切相同,除了
Listener[Source="GPO"]
.
.
.
ListeningOn=null
我想配置它使其正确侦听。
PART II
而当我在我的远程机器
winrm id -r:<machine name>
winrm get winrm/config -r:<machine name>
winrm get wmicimv2/Win32_Service?Name = WinRM -r:<machine name>
上运行一个这些命令之一,它提供了一个的WSMan故障,并显示错误消息:
The client cannot connect to the destination specified in the request. Verify
that the service on the destination is running and is accepting requests.Consult
the logs and documentation for WS-Management service running on the destination,
most commonly IIs or WinRM. If the destination is the WinRM service, run the
following command on the destination to analyse and configure the WinRM service:
"winrm quickconfig".
然而,当我在本地机器上运行时,相同的命令运行正常。
winrm id
winrm get winrm/config
winrm get wmicimv2/Win32_Service?Name = WinRM
至多,我面临的所有问题都在我的远程机器上。 是什么导致了这种情况发生,我怎样才能配置它来侦听和连接成功? 谢谢。
第二部分,我现在可以在我的其他远程机器上以正确的输出运行它们。
我在这个特定的远程机器上做了一些改变,因为我已经发布了这个问题,所以它不会运行这些命令,直到我修复了第一部分,除此之外,如果没有任何改变,它会像它一样运行在我的其他远程机器上。
我还是感激,如果有人可以帮助我第一部分中,我要摆脱
Listener[Source=GPO]
..
.
ListeningOn=null
当我运行该命令
winrm e winrm/config/listener
,因为这是什么原因造成的问题但我不确定如何禁用/删除组策略设置。
'telnet 5985'建立连接吗?你在哪个“本地机器”上得到了“ListeningOn”的输出?你在两台主机上运行过'winrm qc'吗? –
是的,我在两台(本地和远程机器上)都运行winrm qc,它们都为我提供winRM设置的正确输出。 而我只是在我的问题中进行了更正,'ListeningOn = null'在远程机器上。 – sanya
检查远程主机上是否存在阻止WinRM侦听的策略。您是否尝试启用远程主机上的侦听器? ('winrm set winrm/config/Listener?地址= * + Transport = HTTP @ {Enabled =“true”}') –