4

I am trying to connect to an Exchange server via a wsman connection using PowerShell. The client server in question is in a Workgroup, while the Exchange server is in its own domain.

I use the following command to try to connect to the server:

connect-wsman -connectionuri http://servername/PowerShell -credential domain\administrator

I then get the full error:

Connecting to remote server 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.

This worked previously when the client server in question was in the same domain as the Exchange server. Firewalls are off, all servers are TrustedHosts with respect to WinRM.

Interestingly, when I use:

connect-wsman -computername servername -credential domain\administrator

I do not get any errors. However, I need to be able to use the URI instead of the computer name.

Any Ideas?

user2996787
  • 41
  • 2
  • 4
  • This question should be on ServerFault. – Raf Jun 09 '14 at 09:00
  • 1
    I will try on ServerFault as well. The issue is showing up in my C# code as well which is why it was posted here originally. – user2996787 Jun 09 '14 at 12:23
  • what does this URI means '-connectionuri http://servername/PowerShell' ? For WSMAN you should use something like http://servername:5985/wsman – John Nov 05 '15 at 19:47

1 Answers1

0

To work on exchange server I use an other method with New-PSSession to my exchange server and Import-PSSession to load remote exchange functions locally

$PSExchSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "http://$($Exch.dNSHostName)/PowerShell/" -Credential (Get-CredentialByRegistry "$AD\Administrateur") -Authentication Kerberos
Import-PSSession $PSExchSession -CommandName 'Get-Mailbox','Get-MailboxStatistics','Get-ActiveSyncDeviceStatistics' -AllowClobber
Alban
  • 3,105
  • 5
  • 31
  • 46