New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

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

Free PRTG
Download >>

 

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


Where should powershell.exe be ?

Votes:

0

Your Vote:

Up

Down

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 by  Stefan Mansier (0) 1



4 Replies

Votes:

0

Your Vote:

Up

Down

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

Your Vote:

Up

Down

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 by  Stefan Mansier (0) 1

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



Votes:

0

Your Vote:

Up

Down

Anyone any idea's ?

Created on Jul 15, 2010 7:52:52 AM by  Stefan Mansier (0) 1



Votes:

0

Your Vote:

Up

Down

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]



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.