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

Custom EXE/Script Sensor needs to run as Admin

Votes:

0

I'm creating a powershell script that queries processes on a server, however I use a parameter that needs elevated rights. Is there a way to get the sensor to launch the powershell process as admin? The sensor ends up returning "Response not wellformed as it's getting the Powershell error back.

Response not wellformed:

(Get-Process : The 'IncludeUserName' parameter requires elevated user rights. Try running the command again in a session that has been opened with elevated user rights (that is, Run as Administrator). At C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXE\LoggedOnUserPRTG.ps1:1 char:22 + $ExplorerProcesses = Get-Process explorer -IncludeUserName | Select-Object -Prop ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Get-Process], InvalidOper ationException + FullyQualifiedErrorId : IncludeUserNameRequiresElevation,Microsoft.Power Shell.Commands.GetProcessCommand )" (code: PE132)

custom-script-exe powershell processes

Created on Dec 22, 2017 7:09:23 PM

Last change on Dec 25, 2017 10:01:36 AM by  Dariusz Gorka [Paessler Support]



3 Replies

Votes:

0

Hi there,

The process is most likely executed via the SYSTEM-User. Please enter valid credentials in the device settings under "Windows Credentials" and enable the "Use Credentials of Parent Device" option in the sensor settings. The script will then be executed with the credentials in the device settings.

Best regards.

Created on Dec 25, 2017 10:03:08 AM by  Dariusz Gorka [Paessler Support]



Votes:

0

Hi, Thanks for the response.

That is currently how I have the sensor configured. Valid credentials for the PRTG user are in device settings, and I've confirmed that the user is able to run the script outside of PRTG without problems. It seems it's solely an issue that the sensor is not launching the process with 'RunAs'. Even outside of PRTG I have to Lauch an interactive session as Administrator, otherwise the -IncludeUserName parameter will fail.

Created on Dec 26, 2017 8:17:32 PM



Votes:

0

Hi there,

Due to the nature how the script is executed, we do not support interactive sessions. Additionally, the script will be started with the "-noprofile"-tag which will disable any "Get Credentials" commands, due to security concerns.

Best regards.

Created on Dec 26, 2017 8:40:14 PM by  Dariusz Gorka [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.