The WinRM client cannot process the request. It cannot determine the content type of the EMS Exchange Shell

The WinRM client cannot process the request. It cannot determine the content type of the

Mã lỗi:

VERBOSE: Connecting to LAB-EX2013.phuongit.lab.

New-PSSession : [lab-ex2013.phuongit.lab] Connecting to remote server lab-ex2013.phuongit.lab 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

+ New-PSSession -ConnectionURI “$connectionUri” -ConfigurationName Microsoft.Excha …

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : OpenError: (System.Manageme….RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin

gTransportException

+ FullyQualifiedErrorId : -2144108297,PSSessionOpenFailed

VERBOSE: Connecting to LAB-EX2013.phuongit.lab.

New-PSSession : [lab-ex2013.phuongit.lab] Connecting to remote server lab-ex2013.phuongit.lab 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

+ New-PSSession -ConnectionURI “$connectionUri” -ConfigurationName Microsoft.Excha …

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : OpenError: (System.Manageme….RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin

gTransportException

+ FullyQualifiedErrorId : -2144108297,PSSessionOpenFailed

VERBOSE: Connecting to LAB-EX2013.phuongit.lab.

New-PSSession : [lab-ex2013.phuongit.lab] Connecting to remote server lab-ex2013.phuongit.lab 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

+ New-PSSession -ConnectionURI “$connectionUri” -ConfigurationName Microsoft.Excha …

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : OpenError: (System.Manageme….RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin

gTransportException

+ FullyQualifiedErrorId : -2144108297,PSSessionOpenFailed

VERBOSE: Connecting to LAB-EX2013.phuongit.lab.

New-PSSession : [lab-ex2013.phuongit.lab] Connecting to remote server lab-ex2013.phuongit.lab 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

+ New-PSSession -ConnectionURI “$connectionUri” -ConfigurationName Microsoft.Excha …

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : OpenError: (System.Manageme….RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin

gTransportException

+ FullyQualifiedErrorId : -2144108297,PSSessionOpenFailed

VERBOSE: Connecting to LAB-EX2013.phuongit.lab.

New-PSSession : [lab-ex2013.phuongit.lab] Connecting to remote server lab-ex2013.phuongit.lab 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

+ New-PSSession -ConnectionURI “$connectionUri” -ConfigurationName Microsoft.Excha …

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : OpenError: (System.Manageme….RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin

gTransportException

+ FullyQualifiedErrorId : -2144108297,PSSessionOpenFailed

Failed to connect to an Exchange server in the current site.

Enter the server FQDN where you want to connect.:

YÊU CẦU

  • Set PowerShell Execution Policies
  • Verify WinRM IIS Extensions
  • Enable Windows Authentication for PowerShell Virtual Directory
  • Verify SSL setting for PowerShell Virtual Directory
  • Verify the application pool for PowerShell Virtual Directory
  • Verify the Security in for PowerShell Virtual Directory

Kiểm tra

  • Set PowerShell Execution Policies

  • Verify WinRM IIS Extensions => Nếu chưa cài phải cài

  • Enable Windows Authentication for PowerShell Virtual Directory
  • Verify SSL setting for PowerShell Virtual Directory

  • Verify the application pool for PowerShell Virtual Directory

Also, under Powershell Virtual Directory → Basic Settings → Make sure you have the Correct application pool (MSExchangePowerShellAppPool or MSExchangePowerShellFrontEndAppPool) and Physical path (C:\Program Files\Microsoft\Exchange Server\V<Exchange Version>\ClientAccess\PowerShell) selected to access the PowerShell virtual directory on the host under IIS root as shown:

  • Verify the Security in for PowerShell Virtual Directory
  • Also make sure the Exchange user has read permissions on the Physical path specified. To do this go to PowerShell Virtual Directory → Edit Permissions → Security tab → Assign read permissions to user performing the scan as shown:

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.snapin;

Set-User “Administrator” -RemotePowerShellEnabled $true

Get-User -Identity “Administrator” | Format-List RemotePowerShellEnabled

KHỞI ĐỘNG SERVER LẠI NHÉ

TEST

TEST NEW USER FOR EMS

  • Add new user account in Active Directory
  • Add Roles/Group membership for new created user account
  • Enable Remote PowerShell for new created user account

NGUYÊN NHÂN

Có thể 1 trong các nguyên nhân sau

This problem occurs because one or more of the following conditions are true:

  • There is a configuration issue on the Exchange server with the Authentication Providers set on the PowerShell website.
  • The Kerbauth module is configured incorrectly in Internet Information Services (IIS) in one of the following ways:
    • The Kerbauth module is displayed as a Managed module instead of as a Native module.
    • The Kerbauth module has been loaded on the Default website level (instead of, or in addition to, the PowerShell virtual directory).
  • The user does not have Remote PowerShell Enabled status.
  • The WSMan module entry is missing from the Global modules section of the ApplicationHost.config file that is in the following location:
    C:\Windows\System32\Inetsrv\config\ApplicationHost.config

This causes the WSMan module to be displayed as a Managed module in the PowerShell virtual directory.

RESOLUTION OTHER

The Kerberos authentication needs to be configured on the PowerShell website on the Exchange Mailbox Server:

  1. Establish a remote connection to the Exchange server in question.
  2. Click Run and enter inetmgr.
  3. Expand the server in the left-hand pane.
  4. Expand the Sites and Default Web Site trees, and then click PowerShell.
  5. Double-click Authentication under the IIS section.

  1. Chọn enable Windows Authentication-> Providers

  1. Right-click on Windows Authentication, and then select Providers.

  1. If the Negotiate:Kerberos item is not present, add it through the Available Providers dialog box.


The AppInsight for Exchange data will be populated during the next SAM polling process. You can also click on Poll Now to obtain results immediately.

Test-WsMan

In IIS Manager, Kerbauth should be listed as a Native module in the PowerShell virtual directory. The DLL location for this module should point to

C:\Program Files\Microsoft\Exchange Server\v15\Bin\kerbauth.dll.

Make sure that the WSMan module is registered but not enabled at the Server level. Also make sure that the WSMan module is enabled for the PowerShell virtual directory. Then, verify that the following WSMan module entry is included in the <globalModules> section of the C:\Windows\System32\Inetsrv\config\ApplicationHost.config file as follows:

XMLCopy

<globalModules>

<add name=”WSMan” image=”C:\Windows\system32\wsmsvc.dll” />

Kiểm tra thiếu chưa cài WinRM IIS Extension feature

Khởi động lại IIS hoặc máy chủ để test lại

Kiểm tra lại: C:\Windows\System32\Inetsrv\config\ApplicationHost.config

Đảm bảo có dòng này

<add name=”WSMan” image=”%windir%\system32\wsmsvc.dll” />

Recommended Posts