Solution for powershell remoting error “It cannot determine the content type of the HTTP response from the destination computer…”

I tried to set up powershell remoting on a server and kept getting this error:

Enter-PSSession : Connecting to remote server failed with the following error message : The WinRM client cann
ot process the request. It cannot determine the content type of the HTTP response from the destination comput
er. The content type is absent or invalid. For more information, see the about_Remote_Troubleshooting Help to
pic.

After a bit of troubleshooting I discovered that the problem was that the authentication packets was to big (over 16k), this will cause WinRM to reject the request. The reason for authentication packets getting too big can be because the user is member of very many security groups or in my case because of the SidHistory attribute.

The solution was to increase the MaxFieldLength and MaxRequestBytes keys in the registry under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\HTTP\Parameters

If the keys does not exists you can create them, be sure to use the DWORD type.

I sat MaxFieldLength to DEC value 40000 and MaxRequestBytes to DEC value 32768 and rebooted the server. Problem solved.

This entry was posted in Uncategorized, Windows Server and tagged , , , . Bookmark the permalink.

13 Responses to Solution for powershell remoting error “It cannot determine the content type of the HTTP response from the destination computer…”

  1. Seán says:

    Thanks for sharing. This was exactly my issue – our domain has many groups and from what you mention this was likely the cause.

  2. Tom says:

    Hi
    Had excatly the sam issue… Thanks for your solution.

    Regards

  3. Tim says:

    Man, you are a life saver!!
    How did you ever manage to trouble shoot this.
    Awsome work tough

  4. Ezra Shiram says:

    Hey,
    Mine are already set to 65536 for each value. Is it OK to increase it above that? If yes, which value should I set it at?

    Thanks!!

    • oyvind says:

      That sound like the maximum size. But you could try to increase it. Please tell me if it worked. If not, you might check if your user is a member of too many groups.

      • Rana Omer says:

        I am in a similar situation and i also see the values 65536 for both, I increased it to 75000 but i am still getting the error.

  5. Stéphane A. says:

    Thk’s issue resolved

  6. Pingback: Enabling WinRM on Domain Controllers | Regular SysAdmin

  7. I’m having this problem and just trying to run “Hello world” on localhost. I enabled PSRemoting and then try invoke-command localhost {“Hello world”} and I get this error!

    Don’t understand what this would have to do with authentication.

    jj

  8. Haitham says:

    THANK YOU ! you saved my day !!!

  9. Bobby Thompson says:

    You fail to say whether you made the registry changes on the client or on the server. That would be useful information.

Leave a Reply

Your email address will not be published. Required fields are marked *