Test-WSMan 适用于 localhost,但不适用于完全限定域名或主机名

Test-WSMan 适用于 localhost,但不适用于完全限定域名或主机名

我有一台 Windows 10 1909 Build 18363。机器,以下是我观察到的情况。这一切都在具有提升权限的 powershell 上进行。

PS C:\Users\mohit.thakral> Test-WSMan -ComputerName localhost


wsmid           : http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd
ProtocolVersion : http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd
ProductVendor   : Microsoft Corporation
ProductVersion  : OS: 0.0.0 SP: 0.0 Stack: 3.0



PS C:\Users\mohit.thakral> Test-WSMan -ComputerName myhostname
Test-WSMan : <f:WSManFault xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="2150858770" Machine="myhostname.company.com"><f:Message>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 the 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 analyze and configure the WinRM service: "winrm quickconfig". </f:Message></f:WSManFault>
At line:1 char:1
+ Test-WSMan -ComputerName myhostname
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (dsw024166:String) [Test-WSMan], InvalidOperationException
    + FullyQualifiedErrorId : WsManError,Microsoft.WSMan.Management.TestWSManCommand

我已经检查了防火墙,我的 winrm 监听器正在监听所有 IP。winrm qc也能正常工作。

还可能存在哪些问题。

答案1

因此,解决方法是这样的setspn -f -q */mymachinename。似乎我的凭据不允许我连接到任何 winrm 服务器。运行此命令后,setspn -f -q */mymachinename问题就解决了

相关内容