I have a Powershell Script:
(Get-Counter @("\Terminal Service Gateway\Current connections") -ComputerName "10.182.2.20").CounterSamples.CookedValue
When i run it on PRTG Server, it return result normal:
PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXE> .\RDPGWSession.ps1 37
But when i add to prtg custom sensor it error:
Custom EXE/Script Sensor
Response not well-formed: "(Get-Counter : Unable to access the desired computer or service. Check the permissions and authentication of the log service or the interactive user session against those on the computer or service being monitored. At C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXE\RDPGWSession.ps1:1 char:2 + (Get-Counter @("\Terminal Service Gateway\Current connections") -ComputerName "1 ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ + CategoryInfo : InvalidResult: (:) [Get-Counter], Exception + FullyQualifiedErrorId : CounterApiError,Microsoft.PowerShell.Commands.Ge tCounterCommand )" (code: PE132)
How to fix it?
Thanks
Add comment