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 }
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
Mar, 2013 - Permalink