powershell WinRM无法完成该操作,请验证指定的计算机名称是否有效

omtl5h9j  于 2023-02-19  发布在  Shell
关注(0)|答案(4)|浏览(431)

当我尝试获取远程计算机上的服务信息时,出现了一个WINRM错误。

PS C:\Windows\system32> invoke-command -computername Node1 -ScriptBlock {gsv}
 [Node1] Connecting to remote server Node1 failed with the following error      
 message : WinRM cannot complete the operation. Verify that the specified computer 
 name is valid, that the computer is accessible over the network, and that a firewall 
 exception for the WinRM service is enabled and allows access from this computer. By 
 default, the WinRM firewall exception for public profiles limits access to remote computers
 within the same local subnet. For more information, see the about_Remote_Troubleshooting Help topic.
+ CategoryInfo          : OpenError: (Node1:String) [], PSRemotingTransportException
+ FullyQualifiedErrorId : WinRMOperationTimeout,PSSessionStateBroken
jw5wzhpr

jw5wzhpr1#

尝试以下解决方法以修复WINRM问题。
连接到远程服务器并以管理员身份从cmd运行以下命令。

C:\Windows\system32>WinRM quickconfig
 WinRM service is already running on this machine.
 WinRM is not set up to allow remote access to this machine for management.
 The following changes must be made:

 Create a WinRM listener on HTTP://* to accept WS-Man requests to any IP on this
 machine.

 Make these changes [y/n]? y

 WinRM has been updated for remote management.

 Created a WinRM listener on HTTP://* to accept WS-Man requests to any IP on this
 machine.
prdp8dxp

prdp8dxp2#

是否检查了远程计算机的防火墙规则?默认规则只允许本地子网中的IP。
要允许其他IP:
1.打开具有高级安全性的Windows防火墙
1.单击 * 入站规则 *
1.双击 Windows远程管理(HTTP-In) 以获得 * 公用 * 配置文件
1.单击 * 范围 * 选项卡
1.在 * 远程IP地址 * 下,添加所需的任何IP

ni65a41a

ni65a41a3#

两台计算机上是否都启用了WinRM???

winrm quickconfig

并检查它。

c9qzyr3d

c9qzyr3d4#

你查过5985号港口了吗?
尝试使用IP地址连接Telent端口
1.以管理员身份打开CMD运行
1.泰伦特10.xx.xx.xxx 5985

相关问题