Share via


Error msg: “No snap-ins have been registered for Windows PowerShell version 2.”

A customer reported the “No snap-ins have been registered for Windows PowerShell version 2.” Error message running their code on a windows 2008 r2 server box.

They were running code that would haven run inside a c# application which called used the Microsoft.Exchange.Management.Powershell.Admin namespace to call the powershell enable-mailbox cmdlet.

 

On cause of this error message is worth checking how you are registering the snapin on W2K8 R2? We have seen instances where customers used wrong version of installutil.exe and the snapin got registered under WOW hives of a 64bit machine. The Installer tool (Installutil) allows you to install and uninstall server resources by executing installer components in specified assemblies. Check if you are using the correct version of installutil - Framework64 version of installutil.exe to register snapins and trying to load the snapin from a 64bit process.

 

Also review the shortcut to powershell, are you loading up the 32 bit version of 64 bit? When looking at the properties of the shortcuts to Powershell and Powershell(x86) on the start menu they may point to “%SystemRoot%\System32\WindowsPowerShell\V1.0” and “%SystemRoot%\SysWOW64\WindowsPowerShell\V1.0”. check if you intend to run the 32bit version or not?

Comments

  • Anonymous
    July 29, 2010
    Your article are very impressive. Thank you so much. More Wait...

  • Anonymous
    March 21, 2012
    Hi, I am also getting the same error. Can you please tell me how to overcome this problem.

  • Anonymous
    May 07, 2012
    Prethesh - I have the same problem. Did you get any solution? Anybody has any solution to this problem?

  • Anonymous
    December 21, 2014
    SnapIns is old mechanism, Modules is new mechanism. refer to this page: blog.codeinside.eu/.../powershell-snapins-vs-modules

  • Anonymous
    May 27, 2015
    For server 2008 (not r2) you might need to install the provider, www.microsoft.com/.../confirmation.aspx

  • Anonymous
    January 22, 2016
    The issue is that the PowerShell Registry Key is corrupted. Copy the PowerShell Registry key from a working Windows Server 2008 R2 server to the non working one. HKEY_LOCAL_MACHINESOFTWAREMicrosoftPowerShell That worked for me. Uninstalling the PowerShell ISV and reinstalling it did not work.