Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

No snap-ins have been registered for Windows PowerShell version 2

Posted on 2010-09-22
7
Medium Priority
?
6,098 Views
Last Modified: 2012-05-10
Hi.. I'm calling C# code.. I'm getting the following error

"No snap-ins have been registered for Windows PowerShell version 2"

at

 config.AddPSSnapIn("Microsoft.Exchange.Management.PowerShell.Admin", out warning);

What I'm I missing. I have the Exchange Management Tools installed....
thanks
0
Comment
Question by:JElster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 1

Author Comment

by:JElster
ID: 33748509
I'm on 64 get the same message.............  Tired on 32 too......
Tried compliing my page as 64,  I go into PS and see the snap in has been added.
?????????????????????
0
 
LVL 16

Expert Comment

by:Bryan Butler
ID: 33748750
According to this, maybe you need to install exchange Management Tools on the Visual Studio Remote machine...

http://blogs.msdn.com/b/akashb/archive/2009/01/30/howto-using-powershell-in-asp-net-net-framework-2-0.aspx
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 1

Author Comment

by:JElster
ID: 33748763
I did that too.........  The machine shows that they are loaded...........
?????????????????????
0
 
LVL 16

Expert Comment

by:Bryan Butler
ID: 33749090
Can you post the code....maybe set breakpoints to check values....

http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/41c9cd78-74ad-4903-8a77-be6c09724669

It's suggested to compile unmanaged as managed here:
http://stackoverflow.com/questions/492953/calling-powershell-scripts-from-unmanaged-c

"The MS suggestion would probably be to compile specific classes/modules in your generally unmanaged C++ app as managed code (compiling individual files with /clr), and letting the IJW transition code manage the calls to/from it (and calling PowerShell API's from the managed bits). I've been told (from MS VC++ people) that's the expected methodology for adding bits of managed calls to large unmanaged applications."


0
 
LVL 1

Accepted Solution

by:
JElster earned 0 total points
ID: 33749199
Your first link is exaclty my issue.. but what's the solution?
0
 
LVL 16

Expert Comment

by:Bryan Butler
ID: 33754337
http://blogs.msdn.com/b/pareshj/archive/2010/07/30/error-msg-no-snap-ins-have-been-registered-for-windows-powershell-version-2.aspx
From link:
- wrong version of installutil.exe and the snapin got registered under WOW hives of a 64bit machine
- Also review the shortcut to powershell, are you loading up the 32 bit version of 64 bit?

Maybe?
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will help you understand what HashTables are and how to use them in PowerShell.
The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question