Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2010-09-22
7
Medium Priority
?
6,236 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
  • 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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
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

WatchGuard Case Study: Museum of Flight

“With limited money and limited staffing, we didn’t have a lot of choices in terms of what we could do to bring efficiency. WatchGuard played a central part in changing that.” To provide strong, secure Wi-Fi access within the museum, Hunter chose to deploy WatchGuard’s AP120 APs.

Question has a verified solution.

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

A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
A walk-through example of how to obtain and apply new DID phone numbers to your cloud PBX enabled users that are configured in Office 365. Whether you have 1, 10 or 100+ users in your tenant, it's quite easy to get them phone-enabled and making/rece…
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 anti-spam), the admin…
Screencast - Getting to Know the Pipeline

916 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