ActiveXPosh and VirtualMachineManager

This forum can be browsed by the general public. Posting is no longer allowed as the product has been discontinued.
Locked
User avatar
momoca
Posts: 2
Joined: Sun Aug 09, 2009 5:59 pm

ActiveXPosh and VirtualMachineManager

Post by momoca » Sun Aug 09, 2009 5:59 pm

Can someone please help me? Has anyone got ActiveXPosh and VirtualMachineManager to work for them? I'd appreciate any help or advice. Thanks!

Option Explicit Dim ActiveXPosh Dim Command Const OUTPUT_CONSOLE = 0 Const OUTPUT_WINDOW = 1 Const OUTPUT_BUFFER = 2 Function CreateActiveXPosh() Dim success Set ActiveXPosh = CreateObject("SAPIEN.ActiveXPoSH") success = ActiveXPosh.Init(vbFalse) If success <> 0 then WScript.Echo "Init failed" end if ActiveXPosh.OutputMode = OUTPUT_CONSOLE End Function CreateActiveXPosh
ActiveXPosh.Execute("Add-PSSnapin Microsoft.SystemCenter.VirtualMachineManager")

Command = "Get-VM"

ActiveXPosh.Execute(Command)

User avatar
Alexander Riedel
Posts: 7209
Joined: Tue May 29, 2007 4:43 pm

ActiveXPosh and VirtualMachineManager

Post by Alexander Riedel » Sun Aug 09, 2009 7:36 pm

It would help if you would elaborate on what error you get.
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
momoca
Posts: 2
Joined: Sun Aug 09, 2009 5:59 pm

ActiveXPosh and VirtualMachineManager

Post by momoca » Mon Aug 10, 2009 12:13 am

Add-PSSnapin : No snap-ins have been registered for Windows PowerShell version 2.At line:1 char:13+ Add-PSSnapin <<<< Microsoft.SystemCenter.VirtualMachineManager + CategoryInfo : InvalidArgument: (Microsoft.Syste...lMachineManager:String) [Add-PSSnapin], PSArgumentException + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommandThe term 'get-vm' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.At line:1 char:7+ get-vm <<<< + CategoryInfo : ObjectNotFound: (get-vm:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

User avatar
Alexander Riedel
Posts: 7209
Joined: Tue May 29, 2007 4:43 pm

ActiveXPosh and VirtualMachineManager

Post by Alexander Riedel » Mon Aug 10, 2009 7:12 pm

The error clearly indicates that the snapin is not installed. Are you trying to access a 64 bit snapin from a 32 bit component?
Alexander Riedel
SAPIEN Technologies, Inc.

Locked