Forum Discussion

Surfer10's avatar
Surfer10
Copper Contributor
Jun 29, 2022

connecting to exchange 2010 server

A long time i connected to exchange on premise 2010 server from a client. The command to connect (run powershell as admin or special user which has rights to exchange remote):

 

 

$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http:///PowerShell/ -Authentication Kerberos -Credential $UserCredential

 

 

In stead of "powershell" i fill in the fqdn of the exchange server. This always worked but not anymore. I do not know what changed locally or on the exchange server but this is the error:

 

New-PSSession : [servername.fqdn] Connecting to remote server fqdn failed with the following e
rror message :

Cannot connect to the destination that is given on request. Check that the  service is running on the destination and accepts requests.

Read the log for wsman, check the management service which is stared on the destination (usually WINRM or IIS, if it is winrm start winrm quickconfig.

see the about_Remote_Troubleshooting Help topic.
At line:1 char:12
+ $Session = New-PSSession -ConfigurationName Microsoft.Exchange -Conne ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin
gTransportException
+ FullyQualifiedErrorId : CannotConnect,PSSessionOpenFailed

 

 

the exchange 2010 server is accepting requests, winrm quickconfig says this and is running.

I have downloaded and started emtshooter to see what the problem could be: emtshooter says that the account that is running does not have exchange remote access. To check this run the following command on exchange:

(get-user domain\user).remotepowershellenabled

for all the users which i use in Powershell it says enabled (this is very strange) i have tried users with domain without domain  and fqdn but they all have remotepowershell enabled.

 

 

What can this be, if it is not the Exchange fw?

 

  • I see http in the connection URL, in IIS Manager the virtual directory Powershell is there? No redirection for everything http to https?
    • Surfer10's avatar
      Surfer10
      Copper Contributor
      powershell is present beneath sites-default site
      • Running EMTshooter should fix that normally, restarting the Appplication pool for PowerShell in IIS does nothing? Exchange Management Shell on the server does start?
    • Surfer10's avatar
      Surfer10
      Copper Contributor
      I also tried https (is possible without authentication Kerberos) i have read.

Resources