ActiveXPosh and 64bit

This forum can be browsed by the general public. Posting is no longer allowed as the product has been discontinued.
This topic is 13 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
schullo
Posts: 2
Last visit: Wed Sep 10, 2008 12:31 pm

ActiveXPosh and 64bit

Post by schullo »

Any plans for ActiveXPosh functionality on 64bit Windows?
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

ActiveXPosh and 64bit

Post by Alexander Riedel »

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
Last visit: Thu Feb 12, 2009 11:27 pm

ActiveXPosh and 64bit

Post by jidnan »

Hello, ...Any update on this? --Thanks, Nick
User avatar
zeshin
Posts: 1
Last visit: Fri Apr 03, 2009 12:56 am

ActiveXPosh and 64bit

Post by zeshin »

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: 373
Last visit: Fri Sep 16, 2022 1:24 pm

ActiveXPosh and 64bit

Post by Ferdinand Rios »

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: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

ActiveXPosh and 64bit

Post by Alexander Riedel »

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
Last visit: Wed Jun 02, 2010 8:06 am

ActiveXPosh and 64bit

Post by pgb_bwp »

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
Last visit: Wed May 05, 2010 1:50 am

ActiveXPosh and 64bit

Post by anupamagarwal »

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: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

ActiveXPosh and 64bit

Post by Alexander Riedel »

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
Last visit: Wed May 05, 2010 1:50 am

ActiveXPosh and 64bit

Post by anupamagarwal »

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
This topic is 13 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.