0

Been setting up Powershell Remoting for all of our client machines (Pushed out GPO last week) and I can Test-WSMan on pretty much all of them and I get a nice expected response.

Now on one of our servers (our SCCM 2012 with all the latest updates) it's yo-yoing between working and not working and it's driving me nuts.

[Note for the following this is a continuous logon to the server via RDP over the course of several days]

This was friday afternoon

PS C:\Windows\System32\WindowsPowerShell\v1.0\Traces> Enter-PSSession -ComputerName D0373910

[D0373910]: PS C:\Users\A-RJS39534\Documents> Exit-PSSession

Then Saturday morning from the SAME Powershell window

PS BC1:\> Enter-PSSession -ComputerName D0373910
Enter-PSSession : Connecting to remote server D0373910 failed with the following error message : 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.
At line:1 char:1
+ Enter-PSSession -ComputerName D0373910
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (D0373910:String) [Enter-PSSession], PSRemotingTransportException
    + FullyQualifiedErrorId : CreateRemoteRunspaceFailed

Then sunday morning i'm back to

PS C:\Windows\System32\WindowsPowerShell\v1.0\Traces> Enter-PSSession -ComputerName D0373910

[D0373910]: PS C:\Users\A-RJS39534\Documents> Exit-PSSession

And now I'm back to this again

PS C:\Windows\System32\WindowsPowerShell\v1.0\Traces> Enter-PSSession -ComputerName D0373910
Enter-PSSession : Connecting to remote server D0373910 failed with the following error message : 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.
At line:1 char:1
+ Enter-PSSession -ComputerName D0373910
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (D0373910:String) [Enter-PSSession], PSRemotingTransportException
    + FullyQualifiedErrorId : CreateRemoteRunspaceFailed

It's maddening! I've set the registry settings for the over sized kerberos tickets, restarted services, disabled and re-enabled Powershell remoting.

It just seems to be luck of the draw when it wants to work.

Couple things to mention

  • Server has PS 4.0 and most clients have 2.0
  • The system i've been showing has been pingable before each of those attempts above
  • This is NOT for Exchange Server (Seems that is the ONLY thing that comes up when I search for anything about "The content type is absent or invalid." with WinRM or Powershell remoting)

Update 11/29/2016

Operation Event Log

Level       Date and Time           Source                  Event ID Task                       Category 
Information 11/29/2016 10:19:13 AM  Microsoft-Windows-WinRM 33       WSMan Session deinitialize Closing WSMan Session completed successfuly   
Information 11/29/2016 10:19:13 AM  Microsoft-Windows-WinRM 8        WSMan Session deinitialize Closing WSMan Session 
Information 11/29/2016 10:19:13 AM  Microsoft-Windows-WinRM 16       WSMan API call             Closing WSMan shell 
Error       11/29/2016 10:19:13 AM  Microsoft-Windows-WinRM 142      Response handling          WSMan operation CreateShell failed, error code 2150858999 
Information 11/29/2016 10:19:13 AM  Microsoft-Windows-WinRM 254      None                       Activity Transfer 
Information 11/29/2016 10:19:13 AM  Microsoft-Windows-WinRM 11       WSMan API call             Creating WSMan shell with the ResourceUri: http://schemas.microsoft.com/powershell/Microsoft.PowerShell and ShellId: 65AA33C1-1009-411E-8DEB-31E08D35AB17 
Information 11/29/2016 10:19:13 AM  Microsoft-Windows-WinRM 10       WSMan API call             Setting WSMan Session Option (16) - WSMAN_OPTION_TIMEOUTMS_SIGNAL_SHELL with value (60000) completed successfully. 
Information 11/29/2016 10:19:13 AM  Microsoft-Windows-WinRM 10       WSMan API call             Setting WSMan Session Option (17) - WSMAN_OPTION_TIMEOUTMS_CLOSE_SHELL with value (60000) completed successfully. 
Information 11/29/2016 10:19:13 AM  Microsoft-Windows-WinRM 10       WSMan API call             Setting WSMan Session Option (12) - WSMAN_OPTION_TIMEOUTMS_CREATE_SHELL with value (180000) completed successfully. 
Information 11/29/2016 10:19:13 AM  Microsoft-Windows-WinRM 10       WSMan API call             Setting WSMan Session Option (1) - WSMAN_OPTION_DEFAULT_OPERATION_TIMEOUTMS with value (180000) completed successfully. 
Information 11/29/2016 10:19:13 AM  Microsoft-Windows-WinRM 10       WSMan API call             Setting WSMan Session Option (25) - WSMAN_OPTION_LOCALE with value (en-US) completed successfully. 
Information 11/29/2016 10:19:13 AM  Microsoft-Windows-WinRM 10       WSMan API call             Setting WSMan Session Option (26) - WSMAN_OPTION_UI_LANGUAGE with value (en-US) completed successfully. 
Information 11/29/2016 10:19:13 AM  Microsoft-Windows-WinRM 10       WSMan API call             Setting WSMan Session Option (34) - WSMAN_OPTION_USE_INTEARACTIVE_TOKEN with value (0) completed successfully. 
Information 11/29/2016 10:19:13 AM  Microsoft-Windows-WinRM 31       WSMan Session initialize   WSMan Create Session operation completed successfuly 
Information 11/29/2016 10:19:13 AM  Microsoft-Windows-WinRM 6        WSMan Session initialize   Creating WSMan Session. The connection string is: D0375599-/wsman?PSVersion=4.0

Second update 11/29/2016

It just occurred to me in my haste I never clearly spelled out what I am trying to do.

I CAN connect a remote Powershell session TO the SCCM server (2008 R2).

what I can NOT do is connect to another system FROM the SCCM server (note all the systems in question I tried I CAN connect to them from my Windows 10 Desktop via Powershell remoting)

  • Anything additional in the event log? (Microsoft/Windows/Windows Remote Management/Operational) Remember that PS Remoting uses HTTP. Perhaps proxy is mangling the data? Do you have a HTTP proxy server configured on the machine your establishing the session FROM? Does it work consistently if you REMOVE the proxy? Does the proxy config have your local domain name in the bypass list? – Clayton Nov 29 '16 at 14:40
  • @Craig620 Edited post with the Operation Log after attempting Enter-PSSession -ComputerName Also we have no proxy server this is all internal systems on the same domain and the account I'm using has admin rights to all domain PC's and the SCCM server – TofuBug Nov 29 '16 at 15:41
  • Did you by chance try this? social.technet.microsoft.com/Forums/office/en-US/… – Colyn1337 Nov 29 '16 at 16:58
  • @Colyn1337 Yeah that was the first thing I tried even rebooted the entire server. – TofuBug Nov 29 '16 at 22:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.