We help IT Professionals succeed at work.

exchange management shell cannot connect

Louie Alvarez
on
Was working fine a couple days ago, now I am searching online to try to resolve this issue to no avail. I have Exchange 2013 installed and have tried to run the "Exchange Management Shell" but keep getting the following error:

VERBOSE: Connecting to exchange.server.com.
New-PSSession : [exchange.server.com] Connecting to remote server exchange.server.com failed with the following error
message : WinRM cannot process the request. The following error occurred while using Kerberos authentication: Cannot
find the computer exchange.server.com. Verify that the computer exists on the network and that the name provided is
spelled correctly. 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 : NetworkPathNotFound,PSSessionOpenFailed
Failed to connect to an Exchange server in the current site.
Enter the server FQDN where you want to connect.:

I've searched all sorts of combinations of the above error message but nothing comes up that is relevant to the specific error message. Although changes above the FQDN is indeed exchange.server.com. This worked fine just a few days ago and now can't seem to get passed this error and I don't know where to even start. The only thing I've been able to try has been a reboot and ensure all updates are current. Of course that did not help, hence this request from the experts. By the way I am running Exchange Management Shell directly on the Exchange Server so it obviously is on the network.
Comment
Watch Question

Author

Commented:
Scott.Williamson,

Thanks for the link above but although the error applies to my situation the solution didn't. According to the instructions I should find the following on regedit:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\ExchangeServer\v14\AdminTools

On my system with Exchange 2013 I have the following:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\ExchangeServer\v15\RemotePowerShell\exchange.server.com

My system doesn't shown anything else in the ExchangeServer location. See pic:
RegEdit ExchangeServer Settings Available
Justin YeungSenior Systems Engineer

Commented:
as far as I know if you are connecting to exchange as session, it doesn't matter if you have the shell module on your machine or not.

try the command below

$Credentials = Get-Credentail
$ExSession = New-PSSession –ConfigurationName Microsoft.Exchange –ConnectionUri ‘https://whatever.whateveryourdomain.com/PowerShell/?SerializationLevel=Full’ -Credential $Credentials –Authentication Kerberos

Open in new window

Author

Commented:
Justin,

I tried the commands you suggested.

#1: The command does not get recognized as a ...

[PS] C:\Users\EXCHANGE\AppData\Roaming\ClassicShell>$Credentials = Get-Credentail
Get-Credentail : The term 'Get-Credentail' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:16
+ $Credentials = Get-Credentail
+                ~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-Credentail:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
[PS] C:\Users\EXCHANGE\AppData\Roaming\ClassicShell>

#2: When prompted I of course utilized my Administrator account and got an access denied message. Now that is really odd since I used the Admin account...

[PS] C:\Users\EXCHANGE\AppData\Roaming\ClassicShell>$ExSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri 'https://exchange.server.com/PowerShell/?SerializationLevel=Full' -Credential $Credentials -Authentication Kerberos New-PSSession : [exchange.lecme.com] Connecting to remote server exchange.server.com failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:14
+ $ExSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin
   gTransportException
    + FullyQualifiedErrorId : AccessDenied,PSSessionOpenFailed
[PS] C:\Users\XM8Lasers\AppData\Roaming\ClassicShell>

Needless to say this still didn't allow me to access the Exchange Management Shell.
Justin YeungSenior Systems Engineer

Commented:
Typo

Get-credential

Author

Commented:
Thanks. The Get-credential worked fine. Tried the next command which I still get the same user/password error :(

PS C:\Users\EXCHANGE> New-PSSession –ConfigurationName Microsoft.Exchange –ConnectionUri ‘https://exchange.server.com/PowerShell/?SerializationLevel=Full’ -Credential $Credentials –Authentication Kerberos New-PSSession : [exchange.server.com] Connecting to remote server exchange.server.com failed with the following error message : The user name or password is incorrect. For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ New-PSSession –ConfigurationName Microsoft.Exchange –ConnectionUri ‘https://exch ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin
   gTransportException
    + FullyQualifiedErrorId : LogonFailure,PSSessionOpenFailed
Justin YeungSenior Systems Engineer

Commented:
The error message indicated the login credential is not accepted

Are you able to use that credential connecting to exchange shell from a workstation that has exchange management tool installed?

Author

Commented:
After typing in Get-Credential I use my admin account and get the following:

[PS] C:\Users\EXCHANGE\AppData\Roaming\ClassicShell\Pinned>get-credential

cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Credential

UserName                                                                                                       Password
--------                                                                                                       --------
EXCHANGE                                                                                  System.Security.SecureString

So that doesn't seem to be a problem, but when I run the 2nd command I get the access denied message. I'm doing all these attempts directly on the Exchange Server.
Justin YeungSenior Systems Engineer

Commented:
is exchange.server.com your cas server address?

https://exchange.server.com/PowerShell/?SerializationLevel=Full’
Justin YeungSenior Systems Engineer

Commented:
you need to convert get-credential to variable $Credential
$Credential = Get-Credential Domain\UserName

the 2nd command has $Credential specified as credential

Author

Commented:
the cas server address I changed to protect the innocent :)

Author

Commented:
When I enter the following command, I am prompted for password then it goes to the prompt as follows:

[PS] C:\Users\XM8Lasers\AppData\Roaming\ClassicShell\Pinned>$Credential = Get-Credential domain\user
[PS] C:\Users\XM8Lasers\AppData\Roaming\ClassicShell\Pinned>

When I enter the next command I am prompted for User & Password, then get the following (am I entering the command incorrectly?):

[PS] C:\Users\exchange\AppData\Roaming\ClassicShell\Pinned>$ExSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri `https://exchange.server.com/PowerShell/?SerializationLevel=Full' -Credential $Credentials -Authentication Kerberos
New-PSSession : [exchange.server.com] Connecting to remote server exchange.server.com failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:14
+ $ExSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin
   gTransportException
    + FullyQualifiedErrorId : AccessDenied,PSSessionOpenFailed
[PS] C:\Users\XM8Lasers\AppData\Roaming\ClassicShell\Pinned>
Justin YeungSenior Systems Engineer

Commented:
try this

$Credential = Get-Credential
$SessionOptions = New-PSSessionOption –SkipCACheck –SkipCNCheck –SkipRevocationCheck

$Session = New-PSSession -ConnectionUri  'https://exchange.server.com/PowerShell/?SerializationLevel=Full’ –Credential $Credential -Authentication Kerberos –SessionOption $SessionOptions
Justin YeungSenior Systems Engineer

Commented:
I just tested it.

$Credential = Get-Credential DomainName\UserName
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri  'http://FQDNServerName/PowerShell/?SerializationLevel=Full’ –Credential $Credential -Authentication Kerberos

Import-PSSession $Session  -AllowClobber -DisableNameChecking | Out-Null

need http and server name instead of Client Access URL

Author

Commented:
Justin, I thank you for your patience and help wholeheartedly. Your suggestions are getting us closer, but not quite there yet. I entered the command as you instructed and no longer am I getting the denied access error, but still getting an error. This is what occurred after entering the commands:

[PS] C:\Users\EXCHANGE\AppData\Roaming\ClassicShell\Pinned>$Credential = Get-Credential domain\username
[PS] C:\Users\EXCHANGE\AppData\Roaming\ClassicShell\Pinned>New-PSSession -ConnectionUri  'http://exchange.server.com/PowerShell/?SerializationLevel=Full' -Credential $Credential -Authentication Kerberos New-PSSession : [exchange.server.com] Connecting to remote server exchange.server.com failed with the following error message : The WS-Management service cannot process the request. Cannot find the Microsoft.PowerShell session configuration in the WSMan: drive on the exchange.server.com computer. For more information, see the about_Remote_Troubleshooting Help topic.

At line:1 char:1
+ New-PSSession -ConnectionUri  'http://exchange.server.com/PowerShell/?Serializati ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin
   gTransportException
    + FullyQualifiedErrorId : InvalidResourceUri,PSSessionOpenFailed
[PS] C:\Users\EXCHANGE\AppData\Roaming\ClassicShell\Pinned>
Senior Systems Engineer
Commented:
what if taking serialization off........ the error indicate resource URL is invalid..........you might have only enabled ssl which require https

$Credential = Get-Credential DomainName\UserName
 $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri  'http://FQDNServerName/PowerShell/’ –Credential $Credential -Authentication Kerberos

 Import-PSSession $Session  -AllowClobber -DisableNameChecking | Out-Null

Author

Commented:
Justin,

The last command were very promising. No error messages. Here is the commands with status after a specific line is processed.

$Credential = Get-Credential domain\user (prompts me for password)
 $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri  'http://exchange.server.com/PowerShell/’ –Credential $Credential -Authentication Kerberos (processes without error)

 Import-PSSession $Session  -AllowClobber -DisableNameChecking | Out-Null (presents me with a command prompt)

I think that did it. I am testing a few basic Exchange commands, such as version and it seems to be working fine.  I have a question, though, should I process the above command each time I need to get into the Exchange Management Shell in order to process the commands?
Justin YeungSenior Systems Engineer

Commented:
yes, since you are running the shell on the connected server.

Author

Commented:
Justin was very patient, gave a number of solutions, process of elimination, to get to a successful conclusion. His final command entries resolved my lack of access to Exchange Management Shell. He deserves an "Excellent" rating!
Justin YeungSenior Systems Engineer

Commented:
Thanks Louie

Commented:
I resolved this issue by fixing the time on the Exchange server.