Force 64-bit PowerShell?

Votes:

0

Your Vote:

Up

Down

I'm curious if there is a way to force 64-bit PowerShell to be used by PRTG?

32bit-to-64-bit powershell prtg

Created on Jan 29, 2011 1:55:37 AM by  jerephil (0) 1



Best Answer

Accepted Answer

Votes:

0

Your Vote:

Up

Down

Hello

After trying a lot in the syswow64 registry to work around this issue a colleague of mine told me about the sysnative folder. I don’t know what you are trying to do but for example I use the failoverclusters module this way.

Create a custom sensor that executes a .ps1 script that contains the following line: c:\windows\<sysnative>\windowspowershell\v1.0\powershell.exe -file "C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\yourpowershell64bitscript.ps1" Please replace <sysnative> either with "System32" when you want to use the 64bit Powershell or with "SysWOW64" for the 32bit version.

Then create the yourpowershell64bitscript.ps1 powershell script with the 64bit module you want to load and output the values in here. Something like:

<# 
This is handy for reading the logfile of the sensor so you will see the modules available that are not in the the 32 bit version of powershell
_#>
Get-Module –ListAvailable

Import-Module failoverclusters
$csv = Get-Cluster -Name fqdn.clustername
Write-Host $csv.id

When you execute the sensor you will see a powershell.exe *32 in your task manager. Because the sysnative folder is only available from a 32 bit powershell it executes the 64 bit powershell with the –file option. You will see a powershell.exe appear besides the powershell.exe *32.

Hope this gets you further.

PeterStamBam

Created on May 17, 2011 11:32:55 AM by  PeterStamBam (50) 1 1

Last change on Feb 9, 2012 3:07:51 PM by  Konstantin Wolff [Paessler Support] (3,920) 3 2



3 Replies

Votes:

0

Your Vote:

Up

Down

Hello,

I'm afraid that is not possible.

Best Regards.

Created on Jan 31, 2011 11:35:59 AM by  Torsten Lindner [Paessler Support] (19,480) 3 1



Accepted Answer

Votes:

0

Your Vote:

Up

Down

Hello

After trying a lot in the syswow64 registry to work around this issue a colleague of mine told me about the sysnative folder. I don’t know what you are trying to do but for example I use the failoverclusters module this way.

Create a custom sensor that executes a .ps1 script that contains the following line: c:\windows\<sysnative>\windowspowershell\v1.0\powershell.exe -file "C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\yourpowershell64bitscript.ps1" Please replace <sysnative> either with "System32" when you want to use the 64bit Powershell or with "SysWOW64" for the 32bit version.

Then create the yourpowershell64bitscript.ps1 powershell script with the 64bit module you want to load and output the values in here. Something like:

<# 
This is handy for reading the logfile of the sensor so you will see the modules available that are not in the the 32 bit version of powershell
_#>
Get-Module –ListAvailable

Import-Module failoverclusters
$csv = Get-Cluster -Name fqdn.clustername
Write-Host $csv.id

When you execute the sensor you will see a powershell.exe *32 in your task manager. Because the sysnative folder is only available from a 32 bit powershell it executes the 64 bit powershell with the –file option. You will see a powershell.exe appear besides the powershell.exe *32.

Hope this gets you further.

PeterStamBam

Created on May 17, 2011 11:32:55 AM by  PeterStamBam (50) 1 1

Last change on Feb 9, 2012 3:07:51 PM by  Konstantin Wolff [Paessler Support] (3,920) 3 2




Please log in or register to enter your reply.


Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.

PRTG
Network Monitor
Intuitive to Use.
Easy to manage.

150.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Visit
www.paessler.com

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

Top Tags


View all Tags