0

我一直在为这个错误而烦恼。当我尝试启动新的 CIMSession 时,它说找不到计算机。我已经验证两台计算机都在同一个网络上,并且它们都可以相互通信。我可以互相 ping 两台电脑,也可以访问共享文件夹。我可以同时使用 IP 和 NetBIOS 名称 ping。我已将两台 PC 添加到组策略中的受信任主机,并在防火墙上允许它。我错过了什么或我做错了什么?

PS C:\Windows\system32> $session=New-CimSession -ComputerName DESKTOP-FJMTUOQ
New-CimSession : 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.
At line:1 char:10
+ $session=New-CimSession -ComputerName DESKTOP-FJMTUOQ
+          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ConnectionError: (:) [New-CimSession], CimException
    + FullyQualifiedErrorId : HRESULT 0x80338126,Microsoft.Management.Infrastructure.CimCmdlets.NewCimSessionCommand
    + PSComputerName        : DESKTOP-FJMTUOQ

错误

编辑

运行时Test-NetConnection -ComputerName DESKTOP-FJMTUOQ -CommonTCPPort WINRM,我得到以下结果

PS C:\Windows\system32> Test-NetConnection -ComputerName DESKTOP-FJMTUOQ -CommonTCPPort WINRM
WARNING: TCP connect to DESKTOP-FJMTUOQ:5985 failed


ComputerName           : DESKTOP-FJMTUOQ
RemoteAddress          : 10.0.2.15
RemotePort             : 5985
InterfaceAlias         : Ethernet
SourceAddress          : 10.0.2.254
PingSucceeded          : True
PingReplyDetails (RTT) : 0 ms
TcpTestSucceeded       : False

编辑 - 相同的测试但向后(从 DESKTOP-FJMTUOQ 到 WIN-R9HLL0ILD3)

PS C:\Users\freyes.FRANK> Test-NetConnection -ComputerName WIN-R9HLL0ILD37 -CommonTCPPort WINRM                                                                                                                                                                                                                                                                         ComputerName     : WIN-R9HLL0ILD37
RemoteAddress    : 10.0.2.254
RemotePort       : 5985
InterfaceAlias   : Ethernet
SourceAddress    : 10.0.2.15
TcpTestSucceeded : True
4

0 回答 0