Sporadic connectivity issues -> WinRMOperationTimeout,PSSessionStateBroken RRS feed

  • Question

  • Hi there, I am trying to run the following script which works periodically on the server.   Sometimes it will work until SiteC, other times it will work to SiteG and in some cases, it all works.

    When it fails the following errors is displayed:

    Connecting to remote server SERVERNAME failed with the following error message : 
    WinRM cannot complete the operation........
        + CategoryInfo          : OpenError: (SERVERNAME:String) [], PSRemotingTransportException
        + FullyQualifiedErrorId : WinRMOperationTimeout,PSSessionStateBroken

    $Computer = "SERVERNAME"
    $secpasswd = ConvertTo-SecureString "SOMEPASSWORD" -AsPlainText -Force
    $credential = New-Object -typename System.Management.Automation.PSCredential -ArgumentList "DOMAIN\USERNAME",$secpasswd
    $Names = "siteA.qa.ca_HTTP;siteB.qa.ca_HTTP;siteC.qa.ca_HTTP;siteD.qa.ca_HTTP;siteE.qa.ca_HTTP;siteF.qa.ca_HTTP;siteG.qa.ca_HTTP;siteH.qa.ca_HTTP"
     $Names.Split(";") | ForEach-Object -Process {
            echo "$($action) $($_)"
            Invoke-Command -ComputerName $Computer -Credential $credential -ScriptBlock {
                Get-Module WebAdministration
                Invoke-Expression  "$($action) -Name '$($service)'"
            } -ArgumentList $_,$action  

    When looking on the remote server, a Windows Error Reporting is displayed with WinRMAssert message  admin\wmi\wmx\service\wsmanhttplistener.cpp..... Line 2865.

    Any thoughts?

    Thursday, November 9, 2017 7:45 PM

All replies

  • Before continuing please fix your post.  It is loaded with HTML formatting strings.  Do not post from notepad++ or from Word or other formatting editor. Use notepad.


    Thursday, November 9, 2017 7:55 PM
  • Corrected
    Friday, November 10, 2017 1:30 AM
  • Sounds like you have configuration issues or network issues along with a failed exception handler.

    You will need to contact MS Support to get help with this. It is not a scripting issue.


    Friday, November 10, 2017 1:39 AM
  • Thomas,

    Any luck on resolving this? I am seeing the same "WinRMAssert message  admin\wmi\wmx\service\wsmanhttplistener.cpp..... Line 2865." issue on a server that I run invoke-command as well. WinRM crashes eventually. These issues started after the following updates were installed:








    Wednesday, December 13, 2017 3:48 PM
  • Hello together

    Any News here in this Case? We have the same issue on different of our Servers also.

    I controlled one Server about the installed KB.

    and there i found only



    which are installed.

    Tuesday, January 9, 2018 6:04 AM
  • Any luck on this issue? IT randomly appaers on servers in our environment...

    Fault bucket , type 0
    Event Name: WinRMAssert
    Response: Not available
    Cab Id: 0

    Problem signature:
    P1: admin\wmi\wmx\service\wsmanhttplistener.cpp
    P2: 2865

    Tuesday, January 16, 2018 12:33 PM
  • Hi All

    i worked together in a MS Case with a MS Engineer about this Problem.

    We made many tests, and now it looks like we fixed it.

    There is a new Update which we installed.

    And after the installation, my Test Script made 400 Attempts and never get an Error anymore.

    The Update we installed was : KB4057401 found on https://support.microsoft.com/en-us/help/4057401/windows-81-update-kb4057401

    Best Regards

    • Proposed as answer by TOK_TT33 Friday, January 26, 2018 2:19 PM
    Friday, January 26, 2018 12:08 PM
  • Thank you for sharing - KB4057401 solved our problem.

    Updating to Windows Management Framework 5.1 (WMF 5.1) will fix the issue too.

    • Edited by TOK_TT33 Monday, January 29, 2018 7:35 AM
    Friday, January 26, 2018 2:22 PM
  • Hi,

    I'm checking how the issue is going, was your issue resolved?

    And if the replies as above are helpful, we would appreciate you to mark them as answers, and if you resolve it using your own solution, please share your experience and solution here. It will be greatly helpful to others who have the same question.

    Appreciate for your feedback.

    Best Regards,

    Please remember to mark the replies as an answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, January 29, 2018 4:27 AM