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)
Add comment