Installed ActiveXPosh but it doesn't seem to be loaded

This forum can be browsed by the general public. Posting is no longer allowed as the product has been discontinued.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
WintelRob
Posts: 6
Joined: Mon Aug 05, 2013 7:16 pm

Installed ActiveXPosh but it doesn't seem to be loaded

Post by WintelRob » Tue Aug 06, 2013 4:00 pm

I have a Windows Server 2008 R2 system, where I've installed ActiveXPosh 64-bit.

My test script fails with this error:

S:\Scripting\example_using_ActiveXPosh_to_call_PowerShell.vbs(4, 2) ActiveXPoshV3: Could not load file or assembly 'System.Man
agement.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad3
64e35' or one of its dependencies. The system cannot find the file specified.


The first few lines of my test script:

Dim success
' Create the PowerShell connector object
Set ActiveXPosh = CreateObject("SAPIEN.ActiveXPoSHV3")
success = ActiveXPosh.Init(vbFalse) 'Do not load profiles
If success <> 0 then
WScript.Echo "Init failed"
end if
If ActiveXPosh.IsPowerShellInstalled Then
WScript.Echo "Ready to run PowerShell commands"
Else
WScript.Echo "PowerShell not installed"
End If


I've done the command:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319>RegAsm.exe "C:\Program Files\SAP
IEN Technologies, Inc\ActiveXPowerShell V3\ActiveXPoshV3.dll" /codebase
Microsoft (R) .NET Framework Assembly Registration Utility 4.0.30319.1
Copyright (C) Microsoft Corporation 1998-2004. All rights reserved.

Types registered successfully



Anyone have an idea as to why this won't work for me?

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

Re: Installed ActiveXPosh but it doesn't seem to be loaded

Post by Alexander Riedel » Tue Aug 06, 2013 4:28 pm

From the error message it would appear you don't have PowerShell V3 installed. Can you do a
$psversiontable
in a shell?
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
WintelRob
Posts: 6
Joined: Mon Aug 05, 2013 7:16 pm

Re: Installed ActiveXPosh but it doesn't seem to be loaded

Post by WintelRob » Tue Aug 06, 2013 5:19 pm

So this only works with v3?


Name Value
---- -----
CLRVersion 2.0.50727.5466
BuildVersion 6.1.7601.17514
PSVersion 2.0
WSManStackVersion 2.0
PSCompatibleVersions {1.0, 2.0}
SerializationVersion 1.1.0.1
PSRemotingProtocolVersion 2.1

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

Re: Installed ActiveXPosh but it doesn't seem to be loaded

Post by Alexander Riedel » Tue Aug 06, 2013 9:00 pm

Well, no, but you downloaded the V3 version.
Go to the downloads site and download the older
ActiveXPoshV2.zip
For 64 bit you will have to manually run the registration for the component.

And yes, I just updated the names to make it clear which version is for what :-)
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
WintelRob
Posts: 6
Joined: Mon Aug 05, 2013 7:16 pm

Re: Installed ActiveXPosh but it doesn't seem to be loaded

Post by WintelRob » Mon Aug 12, 2013 5:11 pm

Thanks. I couldn't see the difference until you made the name change.

I still can't run it. I've made sure that my .NET Framework v4 is good. I first uninstalled the V3 ActiveXPosh, and then I installed the V2. I get an error trying to run the script: "...can't create object: 'SAPIEN.ActiveXPoSH'".

I will have to try rebooting my workstation.

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

Re: Installed ActiveXPosh but it doesn't seem to be loaded

Post by Alexander Riedel » Mon Aug 12, 2013 6:54 pm

The V2 version, just like Powershell V2, uses the .NET 2.0 runtime.
You need to run the V2 regasm tool against the dll.
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
WintelRob
Posts: 6
Joined: Mon Aug 05, 2013 7:16 pm

Re: Installed ActiveXPosh but it doesn't seem to be loaded

Post by WintelRob » Mon Aug 19, 2013 5:05 pm

On a Windows 2003 Standard 32-bit OS, with .NET Framework 2.0, I get this error (and I tried on two different systems):

C:\Install\ActiveXPoshV2>cscript ActiveXposhV2.vbs
C:\Install\ActiveXPoshV2\ActiveXposhV2.vbs(32, 2) ActiveXPosh: Could not load fi
le or assembly 'System.Management.Automation, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

(On a 64-bit OS with .NET Framework 4.0, I tried installing the ActiveXPoSH v2 DLL, and it didn't work, but the v3 DLL did work.)


I ultimately need to get this working on a 32-bit OS until such time as we can upgrade it to a newer 64-bit OS.

User avatar
WintelRob
Posts: 6
Joined: Mon Aug 05, 2013 7:16 pm

Re: Installed ActiveXPosh but it doesn't seem to be loaded

Post by WintelRob » Mon Aug 19, 2013 5:22 pm

Sorry... I am having trouble keeping track of all of my different systems, in addition to my normal work... This server doesn't have PowerShell installed, so I am now installed PS v2 and then I will re-do the ActiveXPoSH install and registration.

User avatar
WintelRob
Posts: 6
Joined: Mon Aug 05, 2013 7:16 pm

Re: Installed ActiveXPosh but it doesn't seem to be loaded

Post by WintelRob » Mon Aug 19, 2013 5:25 pm

OK, the v2 with PS v2 is working on a Windows Server 2003 32-bit system. I don't know why this wasn't working on my desktop system, but I will assume it has something to do with the fact that I have multiple versions of .NET Framework, including 2.0 and 4.0. I will ignore this and just continue working on the system where I got it working.

Thanks.

Is there any FAQ that has some examples of handling errors returned from calling a PowerShell script?

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

Re: Installed ActiveXPosh but it doesn't seem to be loaded

Post by Alexander Riedel » Mon Aug 19, 2013 5:46 pm

The dlls are compiled to be platform agnostic, they should register and run on 64 and 32 bit systems.
The V2 version needs the 2.0 runtime, just like PowerShell V2
The V3 version needs the 3.0 runtime, just like POwerShell V3

PowerShell error messages tend to be pretty messy and cryptic. Our PowerShell forum is usually a good spot to ask if you get an error message you can't decipher.
Alexander Riedel
SAPIEN Technologies, Inc.

Locked