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

Running SQL Query from Within Powershell EXEXML Sensor

Votes:

0

Im trying to run a SQL script from within a powershell script sensor. But i need to feed the SQL credentials from PRTG into the EXEML Powershell script.... is this possible?

Basically,.. is there any way to access the PRTG credential store from within a powershell script?

Why would i do this? Because i'd like to return different results in different cases, write some stuff to logging etc, which i cant do with plain TSQL.

microsoftsql powershell prtg

Created on Jan 19, 2017 2:57:02 PM



2 Replies

Accepted Answer

Votes:

0

Hello trung,

Thank you very much for your KB-post.

Actually it is not possible to use the SQL credentials which are set in the device-settings of PRTG.
The only suitable way to enter the credentials in PRTG (for the usage in an external script) is by using the Parameters field in the sensor settings.
Kindly be aware to use the right syntax for these parameter. Please see a short example: -host "server1" -user "admin" -password "MyLittleSecret" -param "abc123" For details, please refer to the manual page of the EXE/Script Sensor.

Best regards,
Sven

Created on Jan 20, 2017 9:18:55 AM by  Sven Roggenhofer [Paessler Technical Support]



Votes:

0

ok great many thanks Sven!

Created on Jan 20, 2017 10:05:32 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.