I have written before about the case of a missing shortcut for Exchange PowerShell here http://blogs.technet.com/b/nawar/archive/2010/09/03/exchange-management-shell-ems-missing-after-applying-exchange-2010-sp1.aspx

 

Today while working onsite with a customer trying to executing some Exchange PowerShell commands , we started getting the following

 

“'Microsoft.Exchange.Management.PowerShell.E2010' is not installed on this machine.”

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:

 

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 our 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

 

Admin

 

Windows Registry Editor Version 5.00

 

[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

 

Windows Registry Editor Version 5.00

 

[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"