Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Test-WSMan fails with powershell

Tags:

powershell

rdp

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

I am failing to execute command from this laptop only. RDP connectivity is succeed on this laptop. Below are output from some commands

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

I have enabled Enable-PSRemoting -force, Restart-Service WinRM and tried Test-WSMan but not luck.Please help me to solve this problem.

like image 614
Mahesh Phate Avatar asked Jul 05 '26 21:07

Mahesh Phate


1 Answers

  1. Make sure your host is accessible from local machine and is not in private network if it is in private vpn connection will required.
  2. Verify Host Ip is correct
like image 164
Mahesh Phate Avatar answered Jul 08 '26 20:07

Mahesh Phate



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!