Test-WSMan works with localhost, but doesnt work with fully qualified domain name or Hostname

Server Fault Asked by Mohit on October 2, 2020

I have a windows 10 1909 Build 18363. Machine, following is what I am observing. This is all on an powershell with elevated permissions.

PS C:Usersmohit.thakral> Test-WSMan -ComputerName localhost

wsmid           :
ProtocolVersion :
ProductVendor   : Microsoft Corporation
ProductVersion  : OS: 0.0.0 SP: 0.0 Stack: 3.0

PS C:Usersmohit.thakral> Test-WSMan -ComputerName myhostname
Test-WSMan : <f:WSManFault xmlns:f="" Code="2150858770" Machine=""><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

I have checked firewall, my winrm listener are listening on all ips. winrm qc also works.

What could be other issues.

One Answer

So, the fix was this setspn -f -q */mymachinename . Seems like somehow my credentials was not allowing me to connect to any server for winrm. After running this setspn -f -q */mymachinename it fixed it

Answered by Mohit on October 2, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP