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

Remote Sensor Elevated Status

Votes:

1

I need to be alerted if a website is up, and not if it's down. It's a backup site that shouldn't be running if the primary site is functioning. So I've setup a sensor with a PowerShell script on a remote probe which checks if that IIS site is up. However, when I run the sensor the log on the remote server says, "Process should have elevated status to access IIS configuration data."

UAC is enabled on the server. Any ideas how I can run a powershell script with elevated privileges? Or is there a better way to accomplish this?

Here's the script (minus try/catch):

$script:Exception = $null;
Import-Module WebAdministration
$site = Get-Website -Name "*BackupSite*"
if ($site.state = "Stopped")
{
	$x=[string]"0:OK"
	write-host $x
	exit 0
}
else
{
	$x=[string]"1:WARNING"
	write-host $x
        exit 1
}

powershell prtg sensor

Created on Mar 18, 2013 2:23:01 PM

Last change on Mar 18, 2013 2:47:35 PM by  Konstantin Wolff [Paessler Support]



1 Reply

Accepted Answer

Votes:

0

Hi,
by default a script is run with the same privileges as the remote probe process, which in most cases means with permissions of the local SYSTEM account. You might either try using a other security context for the script which can be done on tab Settings of the sensor with the option Security Context or you might try running the PRTG probe service with an account that has higher permissions.
Best regards

Created on Mar 18, 2013 2:50:17 PM by  Konstantin Wolff [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.