TechTalkz.com Logo

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Microsoft > Microsoft Windows Powershell

Notices

Reply
 
Thread Tools Display Modes
Old 06-06-2008, 03:45 PM   #1
subtile
Guest
 
Posts: n/a
No Windows PowerShell Snap-ins are available for version 1

I get the exception message "No Windows PowerShell Snap-ins are available for
version 1" whenever running following lines of code:

RunspaceConfiguration rc = RunspaceConfiguration.Create();
PSSnapInException snapEx = null;
PSSnapInInfo info =
rc.AddPSSnapIn("Microsoft.Exchange.Management.Powe rShell.Admin", out snapEx);
<-- this line fails

I run my VS projects on a x64 Windows with PS installed
Our Exchange server is on a different machine.

What could be wrong with my setup ?


--

Jesus Loves You
  Reply With Quote
Old 06-06-2008, 04:49 PM   #2
Marco Shaw [MVP]
Guest
 
Posts: n/a
Re: No Windows PowerShell Snap-ins are available for version 1

subtile wrote:
> I get the exception message "No Windows PowerShell Snap-ins are available for
> version 1" whenever running following lines of code:
>
> RunspaceConfiguration rc = RunspaceConfiguration.Create();
> PSSnapInException snapEx = null;
> PSSnapInInfo info =
> rc.AddPSSnapIn("Microsoft.Exchange.Management.Powe rShell.Admin", out snapEx);
> <-- this line fails
>
> I run my VS projects on a x64 Windows with PS installed
> Our Exchange server is on a different machine.
>
> What could be wrong with my setup ?
>
>


Perhaps this helps:
http://blogs.msdn.com/mstehle/archiv...l-snap-in.aspx

Are you compiling your app for 64-bit?

Marco

--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp

PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
  Reply With Quote
Old 06-06-2008, 07:49 PM   #3
kelly goff
Guest
 
Posts: n/a
Re: No Windows PowerShell Snap-ins are available for version 1

Have you installed the Exchange Management tools on the computer you
have VS on?

Kelly

subtile wrote:
> I get the exception message "No Windows PowerShell Snap-ins are available for
> version 1" whenever running following lines of code:
>
> RunspaceConfiguration rc = RunspaceConfiguration.Create();
> PSSnapInException snapEx = null;
> PSSnapInInfo info =
> rc.AddPSSnapIn("Microsoft.Exchange.Management.Powe rShell.Admin", out snapEx);
> <-- this line fails
>
> I run my VS projects on a x64 Windows with PS installed
> Our Exchange server is on a different machine.
>
> What could be wrong with my setup ?
>
>

  Reply With Quote
Old 06-06-2008, 08:54 PM   #4
subtile
Guest
 
Posts: n/a
Re: No Windows PowerShell Snap-ins are available for version 1

Hey Marco... I had already read this url you posted - Several times :-)

It's an ASP.NET web application and I can only choose Mixed Platforms, Any
CPU and .NET in the Configuration Manager.

Kelly: Yes I have installed the Exchange Management tools on the Dev server.

Our Exchange Server and DEV server are right next to eachother in the same
domain.

I've tried to run my code in a console app directly on the Exchange Server
with success. But yet no success from the remote DEV server



"Marco Shaw [MVP]" wrote:
> subtile wrote:
> > I get the exception message "No Windows PowerShell Snap-ins are available for
> > version 1" whenever running following lines of code:
> >
> > RunspaceConfiguration rc = RunspaceConfiguration.Create();
> > PSSnapInException snapEx = null;
> > PSSnapInInfo info =
> > rc.AddPSSnapIn("Microsoft.Exchange.Management.Powe rShell.Admin", out snapEx);
> > <-- this line fails
> >
> > I run my VS projects on a x64 Windows with PS installed
> > Our Exchange server is on a different machine.
> >
> > What could be wrong with my setup ?
> >
> >

>
> Perhaps this helps:
> http://blogs.msdn.com/mstehle/archiv...l-snap-in.aspx
>
> Are you compiling your app for 64-bit?
>
> Marco
>
> --
> Microsoft MVP - Windows PowerShell
> http://www.microsoft.com/mvp
>
> PowerGadgets MVP
> http://www.powergadgets.com/mvp
>
> Blog:
> http://marcoshaw.blogspot.com
>

  Reply With Quote
Old 06-06-2008, 08:54 PM   #5
Marco Shaw [MVP]
Guest
 
Posts: n/a
Re: No Windows PowerShell Snap-ins are available for version 1

subtile wrote:
> Hey Marco... I had already read this url you posted - Several times :-)
>
> It's an ASP.NET web application and I can only choose Mixed Platforms, Any
> CPU and .NET in the Configuration Manager.
>
> Kelly: Yes I have installed the Exchange Management tools on the Dev server.
>
> Our Exchange Server and DEV server are right next to eachother in the same
> domain.
>
> I've tried to run my code in a console app directly on the Exchange Server
> with success. But yet no success from the remote DEV server


(I don't have enough money to get a 64-bit system to play with...)

OK, then maybe you're loading the wrong version of
System.Management.Automation.dll? I'm assuming 2 versions get installed
on 64-bit systems...

Check out also:
http://forums.microsoft.com/TechNet/...1900&SiteID=17

Marco


--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp

PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
  Reply With Quote
Old 06-06-2008, 08:54 PM   #6
kelly goff
Guest
 
Posts: n/a
Re: No Windows PowerShell Snap-ins are available for version 1

The only other thing I can think of is that you are trying to load a 64
bit add-in into a 32 bit version of powershell. I remember making that
mistake.

Kelly
subtile wrote:
> I get the exception message "No Windows PowerShell Snap-ins are available for
> version 1" whenever running following lines of code:
>
> RunspaceConfiguration rc = RunspaceConfiguration.Create();
> PSSnapInException snapEx = null;
> PSSnapInInfo info =
> rc.AddPSSnapIn("Microsoft.Exchange.Management.Powe rShell.Admin", out snapEx);
> <-- this line fails
>
> I run my VS projects on a x64 Windows with PS installed
> Our Exchange server is on a different machine.
>
> What could be wrong with my setup ?
>
>

  Reply With Quote
Old 06-06-2008, 08:54 PM   #7
kelly goff
Guest
 
Posts: n/a
Re: No Windows PowerShell Snap-ins are available for version 1

The only thing I can think of is trying to load a 64 bit add-in to a 32
bit version of PS.

Kelly

subtile wrote:
> Hey Marco... I had already read this url you posted - Several times :-)
>
> It's an ASP.NET web application and I can only choose Mixed Platforms, Any
> CPU and .NET in the Configuration Manager.
>
> Kelly: Yes I have installed the Exchange Management tools on the Dev server.
>
> Our Exchange Server and DEV server are right next to eachother in the same
> domain.
>
> I've tried to run my code in a console app directly on the Exchange Server
> with success. But yet no success from the remote DEV server
>
>
>
> "Marco Shaw [MVP]" wrote:
>> subtile wrote:
>>> I get the exception message "No Windows PowerShell Snap-ins are available for
>>> version 1" whenever running following lines of code:
>>>
>>> RunspaceConfiguration rc = RunspaceConfiguration.Create();
>>> PSSnapInException snapEx = null;
>>> PSSnapInInfo info =
>>> rc.AddPSSnapIn("Microsoft.Exchange.Management.Powe rShell.Admin", out snapEx);


>>>
>>> I run my VS projects on a x64 Windows with PS installed
>>> Our Exchange server is on a different machine.
>>>
>>> What could be wrong with my setup ?
>>>
>>>

>> Perhaps this helps:
>> http://blogs.msdn.com/mstehle/archiv...l-snap-in.aspx
>>
>> Are you compiling your app for 64-bit?
>>
>> Marco
>>
>> --
>> Microsoft MVP - Windows PowerShell
>> http://www.microsoft.com/mvp
>>
>> PowerGadgets MVP
>> http://www.powergadgets.com/mvp
>>
>> Blog:
>> http://marcoshaw.blogspot.com
>>

  Reply With Quote
Old 09-06-2008, 02:45 PM   #8
subtile
Guest
 
Posts: n/a
Re: No Windows PowerShell Snap-ins are available for version 1

Hi Kelly

You're right.. but If I run the same piece of code from a console app there
no problem. How can I tell if I load a snapp-in on a 32bit version i a
ASP.NET app. ?




"kelly goff" wrote:

> The only other thing I can think of is that you are trying to load a 64
> bit add-in into a 32 bit version of powershell. I remember making that
> mistake.
>
> Kelly
> subtile wrote:
> > I get the exception message "No Windows PowerShell Snap-ins are available for
> > version 1" whenever running following lines of code:
> >
> > RunspaceConfiguration rc = RunspaceConfiguration.Create();
> > PSSnapInException snapEx = null;
> > PSSnapInInfo info =
> > rc.AddPSSnapIn("Microsoft.Exchange.Management.Powe rShell.Admin", out snapEx);
> > <-- this line fails
> >
> > I run my VS projects on a x64 Windows with PS installed
> > Our Exchange server is on a different machine.
> >
> > What could be wrong with my setup ?
> >
> >

>

  Reply With Quote
Old 09-06-2008, 03:48 PM   #9
subtile
Guest
 
Posts: n/a
Re: No Windows PowerShell Snap-ins are available for version 1

I just deployed my asp.net project to a IIS with 32bit apppools disabled.
Everything worked fine!!! So the problem is that my x64 Visual Studio doesnt
know how to run as x64 powershell

"kelly goff" wrote:

> The only other thing I can think of is that you are trying to load a 64
> bit add-in into a 32 bit version of powershell. I remember making that
> mistake.
>
> Kelly
> subtile wrote:
> > I get the exception message "No Windows PowerShell Snap-ins are available for
> > version 1" whenever running following lines of code:
> >
> > RunspaceConfiguration rc = RunspaceConfiguration.Create();
> > PSSnapInException snapEx = null;
> > PSSnapInInfo info =
> > rc.AddPSSnapIn("Microsoft.Exchange.Management.Powe rShell.Admin", out snapEx);
> > <-- this line fails
> >
> > I run my VS projects on a x64 Windows with PS installed
> > Our Exchange server is on a different machine.
> >
> > What could be wrong with my setup ?
> >
> >

>

  Reply With Quote
Old 20-06-2008, 08:51 PM   #10
kelly goff
Guest
 
Posts: n/a
Re: No Windows PowerShell Snap-ins are available for version 1

If I am remembering correctly I had to pull the dll's out of the gac and
directly reference those dll's.

Kelly

subtile wrote:
> I just deployed my asp.net project to a IIS with 32bit apppools disabled.
> Everything worked fine!!! So the problem is that my x64 Visual Studio doesnt
> know how to run as x64 powershell
>
> "kelly goff" wrote:
>
>> The only other thing I can think of is that you are trying to load a 64
>> bit add-in into a 32 bit version of powershell. I remember making that
>> mistake.
>>
>> Kelly
>> subtile wrote:
>>> I get the exception message "No Windows PowerShell Snap-ins are available for
>>> version 1" whenever running following lines of code:
>>>
>>> RunspaceConfiguration rc = RunspaceConfiguration.Create();
>>> PSSnapInException snapEx = null;
>>> PSSnapInInfo info =
>>> rc.AddPSSnapIn("Microsoft.Exchange.Management.Powe rShell.Admin", out snapEx);
>>> <-- this line fails
>>>
>>> I run my VS projects on a x64 Windows with PS installed
>>> Our Exchange server is on a different machine.
>>>
>>> What could be wrong with my setup ?
>>>
>>>

  Reply With Quote
Reply

Thread Tools
Display Modes


Google
 


All times are GMT +5.5. The time now is 02:25 AM.


vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2008, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional