当我尝试连接到远程计算机上的 Powershell 时,会发生这种情况:
PS C:\Users\Jonathan> Test-WSMan -ComputerName 54.228.XX.XX
Test-WSMan : The WinRM client cannot complete the operation within the time specified. Check if the machine name is val
id and is reachable over the network and firewall exception for Windows Remote Management service is enabled.
At line:1 char:11
+ Test-WSMan <<<< -ComputerName 54.228.XX.XX
+ CategoryInfo : InvalidOperation: (54.228.XX.XX:String) [Test-WSMan], InvalidOperationException
+ FullyQualifiedErrorId : WsManError,Microsoft.WSMan.Management.TestWSManCommand
在我的远程计算机上,我确认 WinRM 正在运行:
PS C:\Users\Administrator> net start winrm
The Windows Remote Management (WS-Management) service is starting.
The Windows Remote Management (WS-Management) service was started successfully.
我已经确认它正在收听:
PS C:\Users\Administrator> winrm e winrm/config/listener
Listener
Address = *
Transport = HTTP
Port = 5985
Hostname
Enabled = true
URLPrefix = wsman
CertificateThumbprint
ListeningOn = 10.35.XXX.XXX, 127.0.0.1...
我选择信任所有主机:
PS C:\Users\Administrator> Set-Item WSMan:\localhost\Client\TrustedHosts -Value "*" -Force
最后,我允许端口 5985 上的入站连接。我错过了什么吗?!