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)

Article Comments

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.


Dec, 2017 - Permalink

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.


Dec, 2017 - Permalink

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.


Dec, 2017 - Permalink