What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

Where should powershell.exe be ?

Votes:

0

I want to start using powershell scripts and have installed powershell on one of the machines that I have installed a probe on but it keeps on saying powershell.exe not found. Do I need to copy the powershell.exe somewhere ?

location not-found powershell prtg

Created on Jun 3, 2010 1:03:06 PM



4 Replies

Votes:

0

Hello,

once Powershell is correctly installed it should configure the paths (where it's executable files are located) in Windows' settings automatically. There is no need to put the powershell.exe into a special place for PRTG. However, please bear in mind, that PRTG needs to be allowed to access the path where Powershell is installed. Please also bear in mind, that depending on the used OS, PRTG might use the 32bit Powershell (even though a 64bit one might be available).

Best Regards.

Created on Jun 4, 2010 9:13:29 AM by  Torsten Lindner [Paessler Support]



Votes:

0

Aaah yes, I just had to restart the probe itself :)

It runs it now but I dont seem to get the return codes I am using, am I doing something wrong, I am testing with this simple script :

clear-host

$var2=Get-content "\\server1\e$\copy.log"|select-object -last 1

if ($var2.Contains("Closing"))
 {exit 0} 
else
 {exit 2}

Created on Jun 4, 2010 2:19:34 PM

Last change on Jun 4, 2010 2:47:21 PM by  Daniel Zobel [Product Manager]



Votes:

0

Anyone any idea's ?

Created on Jul 15, 2010 7:52:52 AM



Votes:

0

Dear Stefan,

please bear in mind that {exit 0} might only be the exit code which determines the state of the sensor executing the script. If you want to return a value (and/or message), please have a look a PRTGs powershell sample scripts:

$rand = New-Object system.random
[int]$v = $rand.next(1,10)

$x=[string]$v+":OK"
write-host $x

exit 0

The return value lies within the $x in the structure of 'value:message'.

Created on Jul 15, 2010 12:34:05 PM by  Torsten Lindner [Paessler Support]




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.