The windows PowerShell snap-in Microsoft Exchange management PowerShell E2010 is not installed on this machine, The Microsoft Exchange API could not be located

I was working with one of my customer whereas we had issue after upgrading SP. Windows PowerShell snap-in "Microsoft Exchange management PowerShell E2010 is not installed on this machine, The Microsoft Exchange API could not be located”. Because this this his backup was failing too as his backup application executes backup using Microsoft Exchange management PowerShell.

Symptom:

After you upgrade to Exchange Server 2010 Service Pack The windows PowerShell snap-in "Microsoft Exchange management PowerShell E2010 is not installed on this machine, The Microsoft Exchange API could not be located”

 Cause:

This problem can occur if there is a missing value in the registry when Setup is run for AdminToolsRole. The missing registry value is as follows:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns 

  • Microsoft.Exchange.Management.PowerShell.E2010
  • Microsoft.Exchange.Management.PowerShell.Setup
  • Microsoft.Exchange.Management.Powershell.Support

 Resolution:

The first thing we did was to verify that the ConnectFunctions.ps1 , RemoteExchange.ps1 and CommonConnectFunctions.ps1 files are present in the %ExchangeInstallPath%\bin directory. 

Note: If these files are missing, you can copy the files from the Exchange Server 2010 Service Pack installation media (depending on the service pack you are using) to the %ExchangeInstallPath%\bin directory.

These files are present in the \setup\serverroles\common folder. 

Since those files existed on the server that we were having the problem with , we proceeded to check the Exchange registered snap-ins with the following command from the Exchange PowerShell: 

  • Run following cmdlet to verify registry: Get-PSSnapin –Registered

 For Exchange 2010 this should return

 

Name        : Microsoft.Exchange.Management.PowerShell.E2010

PSVersion   : 1.0

Description : Admin Tasks for the Exchange Server

 

Name        : Microsoft.Exchange.Management.PowerShell.Setup

PSVersion   : 1.0

Description : Setup Tasks for the Exchange Server

 

Name        : Microsoft.Exchange.Management.Powershell.Support

PSVersion   : 1.0

Description : Support Tasks for the Exchange Server

 

  • In my case it only returned

 

Name        : Microsoft.Exchange.Management.PowerShell.Setup

PSVersion   : 1.0

Description : Setup Tasks for the Exchange Server

 

Looking at the following registry key on the server (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns) showed only the registry key related to setup, which means we need to manually create the other two registry keys to solve the broken Exchange PowerShell problem.

 The easiest way to do this is by exporting two missing resitry key from a healthy server, but you need to make sure that the install path is exactly the same and servers are running the same version, if the installation path is not the same you can change to match the path on your broken server after exporting the key.

The actual keys are below, but as I mentioned before make sure that the installation path of exchange from server you export from matches the exchange installation path of the server you are importing to

 Windows Registry Editor Version 5.00

 Admin:

 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\Microsoft.Exchange.Management.PowerShell.E2010]

"CustomPSSnapInType"="Microsoft.Exchange.Management.PowerShell.AdminPSSnapIn"

"ApplicationBase"="C:\\Program Files\\Microsoft\\Exchange Server\\V14\\bin"

"AssemblyName"="Microsoft.Exchange.PowerShell.Configuration, Version=14.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

"Description"="Admin Tasks for the Exchange Server"

"ModuleName"="C:\\Program Files\\Microsoft\\Exchange Server\\V14\\bin\\Microsoft.Exchange.PowerShell.Configuration.dll"

"PowerShellVersion"="1.0"

"Vendor"="Microsoft Corporation"

"Version"="14.0.0.0"

 Support:

 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\Microsoft.Exchange.Management.Powershell.Support]

"CustomPSSnapInType"="Microsoft.Exchange.Management.Powershell.Support.SupportPSSnapIn"

"ApplicationBase"="C:\\Program Files\\Microsoft\\Exchange Server\\V14\\bin"

"AssemblyName"="Microsoft.Exchange.Management.Powershell.Support, Version=14.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

"Description"="Support Tasks for the Exchange Server"

"ModuleName"="C:\\Program Files\\Microsoft\\Exchange Server\\V14\\bin\\Microsoft.Exchange.Management.Powershell.Support.dll"

"PowerShellVersion"="1.0"

"Vendor"="Microsoft Corporation"

"Version"="14.0.0.0"

Important: This solution will be applied to any issue where Microsoft Exchange management PowerShell is integrated.  

Thank you,

Mukut-