WinRM - WsManFault - HTTP Bad Request status (400) - Error number: -2144108175 0x80338171

I am trying to configure the WinRM in my servers for eventlog forwarding but I am facing issue when i run "winrm qc" command on domain controllers. I get the following error,

WinRM already is set up to receive requests on this machine.
WSManFault
    Message = The WinRM client received an HTTP bad request status (400), but the remote service did not include any other information about the cause of the failure.

Error number:  -2144108175 0x80338171
The WinRM client received an HTTP bad request status (400), but the remote service did not include any other information about the cause of the failure.

Please help me resolve this. I searched many articles but no result. Nothing helped.

Regards,

Sameer Gawde

September 4th, 2014 11:14am

Hi Sameer,

Before going further, would you please let me confirm edition information of the server OS that this issue occurred? Was it Windows Server 2008 or Windows Server 2008 R2 or any other?

Based on the error message, this issue may occur if the Window Remote Management service and its listener functionality are broken. Please refer to resolution in following KB and check if can help you.

Errors when you run winrm commands to check local functionality in a Windows Server 2008 environment

If any update, please feel free to let me know.

Hope this helps.

Best regards,

Justin Gu

Free Windows Admin Tool Kit Click here and download it now
September 5th, 2014 7:47am

Hello Justin,

The OS is Windows Server 2008 R2 Standard edition with SP1.

Also I have already went through the link you have given. When I try to install KB981845, it says it is not applicable to the version of my OS.

And any further winrm command i enter, it prompts me same error,

WinRM already is set up to receive requests on this machine.
WSManFault
    Message = The WinRM client received an HTTP bad request status (400), but the remote service did not include any other information about the cause of the failure.

Error number:  -2144108175 0x80338171
The WinRM client received an HTTP bad request status (400), but the remote service did not include any other information about the cause of the failure.

Regards,

Sameer

September 5th, 2014 1:31pm

Hi,

Just updating as it worked in my case and can help someone else as well.

The certificate was not that great in my case, even if it was trusted by my client PC and OWA on SSL was just fine.

Changing the connection URI from HTTPS to HTTP worked.

-ConnectionUri http://exch1.contoso.com

"The HTTP error occurs because of the URL not being correct (see => pcsupport.about.com/od/findbyerrormessage/a/400error.htm ) you can try to lower the security and try to connect it without secure sockets (HTTP instead of HTTPS) and see if it works (just an idea) or try to see if the IP adress is correct."

Code I was running:

$cred = Get-Credential

$sessionoption = New-PSSessionOption -SkipCNCheck

$exchangesession = New-PSSession -Credential $cred -ConnectionUri http://exch1.contoso.com/PowerShell -ConfigurationName Microsoft.Exchange -AllowRedirection -SessionOption $sessionoption

Import-PSSession $exchangesession
Get-Mailbox user1 | select exchangeVersion
Get-Mailbox user2 | select prohibitsendquota
Set-MailboxautoReplyConfiguration user1 -starttime 06/06/2015 -Endtime 07/06/2015 -AutoReplyState Scheduled -InternalMessage ="test" -ExternalMessage "test"
get-exchangeserver

Error:

New-PSSession : [exch1.contoso.com] Connecting to remote server exch1.contoso.com failed with the following error
message : The WinRM client received an HTTP bad request status (400), but the remote service did not include any
other information about the cause of the failure. For more information, see the about_Remote_Troubleshooting Help
topic.
At line:1 char:20
+ $exchangesession = New-PSSession -Credential $cred -ConnectionUri https://exch1. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemot
   ingTransportException
    + FullyQualifiedErrorId : -2144108175,PSSessionOpenFailed



References:

Remote connection to an exchange Powershell hosted on IIS


Free Windows Admin Tool Kit Click here and download it now
May 8th, 2015 3:05pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics