gpt4 book ai didi

powershell - Test-WSMan 使用 powershell 失败

转载 作者:行者123 更新时间:2023-12-04 10:24:27 26 4
gpt4 key购买 nike

PS C:\Windows\system32> Test-WSMan x.x.xx.x
Test-WSMan : <f:WSManFault xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="995" Machine="desktop-12"><f:Message>WS-Management cannot process the request. The operation
failed because of an HTTP error. The HTTP error (12152) is: The server returned an invalid or unrecognized response . </f:Message></f:WSManFault>
At line:1 char:1
+ Test-WSMan x.x.xx.x
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (x.x.xx.x:String) [Test-WSMan], InvalidOperationException
+ FullyQualifiedErrorId : WsManError,Microsoft.WSMan.Management.TestWSManCommand

我无法仅从这台笔记本电脑执行命令。 RDP 连接在这台笔记本电脑上成功。下面是一些命令的输出

PS C:\Windows\system32> winrm get winrm/config/service/auth
Auth
Basic = false
Kerberos = true
Negotiate = true
Certificate = false
CredSSP = false
CbtHardeningLevel = Relaxed

PS C:\Windows\system32> Get-NetConnectionProfile

Name : Unidentified network
InterfaceAlias : Ethernet 2
InterfaceIndex : 8
NetworkCategory : Public
IPv4Connectivity : NoTraffic
IPv6Connectivity : NoTraffic

Name : K32806
InterfaceAlias : Wi-Fi
InterfaceIndex : 17
NetworkCategory : Public
IPv4Connectivity : Internet
IPv6Connectivity : NoTraffic

PS C:\Windows\system32> Get-Item wsman:\localhost\client\trustedhosts

WSManConfig: Microsoft.WSMan.Management\WSMan::localhost\Client

Type Name SourceOfValue Value
---- ---- ------------- -----
System.String TrustedHosts x.x.xx.x

我启用了 Enable-PSRemoting -force、Restart-Service WinRM 并尝试了 Test-WSMan 但运气不好。请帮我解决这个问题。

最佳答案

  1. 确保您的主机可从本地计算机访问,并且不在专用网络中,如果它处于专用 vpn 连接中则需要。
  2. 验证主机 IP 是否正确

关于powershell - Test-WSMan 使用 powershell 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56487583/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com