我正在使用命令提示符测试本地和远程计算机的WinRM连接,并且我的问题分为两个部分。
第一部分
我使用ping命令测试了TCP/IP连接,以ping本地计算机和远程计算机的IP地址、默认网关和DNS服务器,并且它在本地和远程计算机上都运行得很好。
但是,在使用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
我希望进行配置以使其正确监听。
第二部分
当我逐个在远程机器上运行这些命令时
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
目前,我面临的所有问题都出现在我的远程机器上。是什么导致了这种情况,我该如何配置它以成功连接并监听?谢谢。
第二部分,我现在能够在我的另一个远程机器上运行这些命令并正确输出。
我对我提出问题的特定远程机器进行了一些更改,因此,在我解决问题I之前,它将无法运行这些命令。但除此之外,如果没有进行任何修改,它会像在我其他的远程机器上一样运行。
我仍然希望有人可以帮助我解决问题I,其中我必须去除...
Listener[Source=GPO]
..
.
ListeningOn=null
当我运行以下命令时:
winrm e winrm/config/listener
因为这是导致问题的原因,但我不确定如何禁用/删除组策略设置。
telnet <IP address> 5985
能够建立连接吗?在哪台“本地机器”上可以得到ListeningOn
的输出?是否在两台主机上都运行了winrm qc
? - Ansgar Wiechers错误:未知开关:encodedcommand
错误:未知开关:inputformat
错误:未知开关:outputformat
错误:命令行使用无效。输入“winrm -?”获取帮助。
- sanya