Search code examples
powershellwinrm

Problem with New-PSSession - content type is absent or invalid


I have weird problem with New-PSSession command. When I try to connect to server with

New-PSSession -ComputerName "xxx"

I have response

The WinRM client cannot process the request. It cannot determine the content type of the HTTP response from the destination computer. The content type is absent or invalid. For more information, see the about_Remote_Troubleshooting Help topic.

But other users can connect to machine. The funny thing is that the same error occurs when logged on this server (I have an error but other person can execute) so it looks like some permission issue. I tried

Set-PSSessionConfiguration -Name "PowerShell.7" -ShowSecurityDescriptorUI

and I can see Administrators can do everything and I'm and administrator on that machine. I also tried tips from this site https://support.entuity.com/hc/en-us/articles/360019058197-How-do-I-configure-and-troubleshoot-WinRM but I still have same error. Any ideas?


Solution

  • I finally found a problem - it was connected with the size of Kerberos token https://learn.microsoft.com/en-us/archive/msdn-technet-forums/4ecb3b43-039a-4c34-9be5-5825bbf82817. When somebody has too many permissions token is to large and configuration mentions in article above should be set.