Mahesh Phate
Mahesh Phate

Reputation: 146

Test-WSMan fails with powershell

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.

Upvotes: 3

Views: 4497

Answers (1)

Mahesh Phate
Mahesh Phate

Reputation: 146

  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

Upvotes: 1

Related Questions