Hi PRTG Knowledge Base,

We're to a REST API to push out notifications using a PowerShell script. We need to use an authorization token to authenticate to the API. I'm wondering whether it's possible to store that token as a credential, and use it in a parameter in the PowerShell script.


Article Comments

Hey, we currently don't offer support for PowerShell scripts. I guess you need to generate a token but we cannot tell you currently tell you how this works in your setup. You can add the script into the template by using the Execute Script option.


Dec, 2022 - Permalink

Hi Marijan,

The script is configured under 'Execute Program'. The question I have is about credentials for this script. Is it possible to add those in the parameters, but store them within PRTG, similarly to how credentials can be used in Custom Sensors?


Dec, 2022 - Permalink

Hello,

"Execute Program" Scripts will be run under the security context of the user running the PRTG service.

If you need this script to be run in another security context you need to adjust your script accordingly to invoke another security context.


Kind regards,
Johannes Beyerlein, Technical Support Team


Dec, 2022 - Permalink