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

How to extract script name field from PRTG sensor with the help of powershell script




I have written powershell script to extract the the information related to sensors like name , id , channel values , priority , interval etc . But I am not finding suitable command to extract the information Script name from relevant sensor . Sensor setting ---> script .

The sensors are in Passelers monitoring tool PRTG . I am extracting data from PRTG server with the help of Powershell script ... but not able to extract data of field called as script ( used to mention script name , used to run in that sensor)

Script Snippet

'Device: ' + $sensor.Device | Out-File -FilePath $outFile -Append 'Type: ' + $sensor.Type | Out-File -FilePath $outFile -Append 'Id: ' + $sensor.ID | Out-File -FilePath $outFile -Append 'Name: ' + $sensor.Name | Out-File -FilePath $outFile -Append

  1. $sensor | Format-Table -AutoSize | Out-File -FilePath $outFile -Append $query | Format-Table -AutoSize | Out-File -FilePath $outFile -Append
  2. $sensor | Get-ObjectProperty | Out-File -FilePath $outFile -Append $sensor | Get-ObjectProperty Tags,IntervalErrorMode,Priority,Interval | Out-File -FilePath $outFile -Append $sensor | Get-Channel | Format-Table -AutoSize | Out-File -FilePath $outFile -Append

May you please share the script format to extract this info

powershell prtg-network-monitor scripting

Created on Jun 23, 2020 7:38:35 AM

1 Reply



I assume you are using the PrtgAPI module (https://github.com/lordmilko/PrtgAPI/).

using the "Get-ObjectProperty" Cmdlet you can get all properties from the sensors like

# script name
(Get-Sensor -Id 20089 | Get-ObjectProperty).ExeFile
# script parameters
(Get-Sensor -Id 20089 | Get-ObjectProperty).ExeParameters

Created on Jul 8, 2020 5:17:46 AM

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.