connecting to exchange 2010 server

Copper Contributor

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?

 

12 Replies
I see http in the connection URL, in IIS Manager the virtual directory Powershell is there? No redirection for everything http to https?
I also tried https (is possible without authentication Kerberos) i have read.
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?
How to restart the application pool for powershell?

Exchange Management shell is running fine but i would like to execute powershell commands from my client like i always have done..

@Surfer10 

Like this screenshot below, select the PowerShell one and Stop/Start it

Harm_Veenstra_1-1656502089162.png

 

@Harm_Veenstra unforunally this makes no difference still cannot connect to Exchange with the same error. Strange thing is that the troubleshooter says that the account is no remote powershell user but if i ask this out in Exchange management shell it says it is...

 

Tried different accounts with domain and without domain but all are not working. This has always worked thouh so there must be something changed.

Patches (Or no patches perhaps ;) )?
tried another client and used powershell 7 now the error is:
Connecting to remote server server.domain failed with the following error message : De WinRM-client heeft een HTTP-statuscode 403 ontvangen van de externe service WS-Management

According to microsoft this error is because SSL is enforced on the powershell module on exchange but this is not the case.
Emtshooter gives the same message when executing it from the other client in pshell 7:
account is not configured for remote powershell, but unfortunally it is.
You could install the client/management tools on your machine and use the add-pssnapin Microsoft.Exchange* in your local PowerShell session?

@Harm_Veenstra 

it is solved, problem was that a proxy was in ise on the machine from which i made a connection…

after using the right proxy settings it worked again..

 

Good to hear that things are ok now