ActiveXPosh and 64bit

Support for all customers who have purchased or received a Productivity Pack Support product license. This forum does not offer a response time guarantee.
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.
User avatar
schullo
Posts: 2
Joined: Tue Aug 26, 2008 12:29 pm

ActiveXPosh and 64bit

Post by schullo » Wed Aug 27, 2008 2:46 am

Any plans for ActiveXPosh functionality on 64bit Windows?

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

ActiveXPosh and 64bit

Post by Alexander Riedel » Wed Aug 27, 2008 2:50 am

It is a .NET assembly, so technically it should all be in place. I'll look into it.

Alex
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
jidnan
Posts: 5
Joined: Mon Feb 09, 2009 12:45 am

ActiveXPosh and 64bit

Post by jidnan » Fri Feb 06, 2009 5:59 am

Hello, ...Any update on this? --Thanks, Nick

User avatar
zeshin
Posts: 1
Joined: Fri Apr 03, 2009 12:56 am

ActiveXPosh and 64bit

Post by zeshin » Fri Apr 03, 2009 12:02 am

I develop a 32-bit application for managing Exchange servers. It's supposed to run on the Exchange server, which means that the server OS is 64-bit. The Exchange Powershell Snapin (Microsoft.Exchange.Management.PowerShell.Admin) is only availible as a 64-bit version. Since the application is 32-bit, Windows run it with the Wow64 redirections.

Before I found the AciveXPosh component, I just ShellExecuted() the Powershell.exe and captured the output - primitive and slow, but it works. To be able to run the 64-bit Powershell.exe from a 32-bit application (and subsequentely load the Exchange PSSnapin), I had to call the Wow64DisableWow64FsRedirection() function (kernel32.dll). That disables the Wow redirection for the current thread, and my 32-bit application can see the 64-bit files and registry keys.

With the ActiveXPosh component, I notice that it is not 64-bit aware and since it loads powershell in a new thread, it fails to load the 64-bit components.

Scenario 1 - I do not run Wow64DisableWow64FsRedirection() before creating the ActiveXPosh.
Results in automation error 0x800700c1 - "%1 is not a valid Win32 application".

Scenario 2 - I run Wow64DisableWow64FsRedirection() before creating the ActiveXPosh.
Init() works and PowerShell commands are working. When I run "Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin", Powershell returns the 32-bit-PS-trying-to-run-64-bit-snapin error:
"Add-PSSnapin : No Windows PowerShell Snap-ins are available for version 1."

It's easy enough to fix ActiveXPosh without rebuilding it as a 64-bit version. Just add the call to Wow64DisableWow64FsRedirection() before loading Powershell, and it should be fine. The function does nothing on a 32-bit OS, and should be harmless to just add.

What do you say? :)

User avatar
Ferdinand Rios
Posts: 369
Joined: Tue Nov 14, 2006 2:56 am

ActiveXPosh and 64bit

Post by Ferdinand Rios » Fri Apr 03, 2009 2:34 am

We will have our dev team take a look at this. If you are willing to work with them on testing, I am pretty certain that they will take a close look at it.
F.G. Rios

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

ActiveXPosh and 64bit

Post by Alexander Riedel » Fri Apr 03, 2009 2:41 am

It's not that simple. We cannot just call Wow64DisableWow64FsRedirection and load 64 bit components.
You simply cannot mix 32 and 64 bit code.

While Wow64DisableWow64FsRedirection is only per thread it just enables you to find the files, it does not allow to load 64 bit components into a 32 bit process.
Alexander Riedel2009-04-03 09:57:38
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
pgb_bwp
Posts: 3
Joined: Wed Jun 02, 2010 6:34 am

ActiveXPosh and 64bit

Post by pgb_bwp » Mon Oct 12, 2009 7:00 am

I'm running What'sUp Gold on 2008 64-bit and it can run customized scripts via VBScript and I was consistently getting issues when trying to use ActiveXPoSH within my script (and I'd also installed the latest version). Turns out that when I ran CScript or WScript from the c:WINDOWSSYSWOW64 folder, it'd run without an issue. Therefore, I tested and found WUG to be running the 64 bit version of CSCRIPT/WSCRIPT out of the %windir%system32 folder, which in turn ran a different registry code-line.Here's how I correct this:I exported the following key:[HKEY_LOCAL_MACHINESOFTWAREClassesWow6432NodeCLSID{6E9C00CA-D11C-424C-A139-1F60F1930165}]and imported it into: [HKEY_LOCAL_MACHINESOFTWAREClassesCLSID{6E9C00CA-D11C-424C-A139-1F60F1930165}]and ActiveXPoSH works like a charm!!!

User avatar
anupamagarwal
Posts: 8
Joined: Mon Jan 11, 2010 2:53 pm

ActiveXPosh and 64bit

Post by anupamagarwal » Mon Jan 11, 2010 6:58 am

Hi Alexander,

Do you have a 64-bit version of ActivePOSH now? It would be very helpful to have one. Thanks!

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

ActiveXPosh and 64bit

Post by Alexander Riedel » Mon Jan 11, 2010 7:41 am

It's a .net assembly, so it doesn't require a specific version. You should be able to register it for 64 bit systems without problem. Just run the 64 bit regasm.exe on it.
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
anupamagarwal
Posts: 8
Joined: Mon Jan 11, 2010 2:53 pm

ActiveXPosh and 64bit

Post by anupamagarwal » Mon Jan 11, 2010 10:21 am

I am not familiar with regasm.exe. Can you please post more specif instructions for doing it? For example, where is regasm.exe located and what file do I run this for? If it is a DLL, where is the file located.

Thanks

Locked