I have a custom sensor calling a batch that does: echo %username%

In settings, security context is set to "Use Windows credentials of parent device". The parent device windows account is set to: MyUser

I'm expecting to see MyUser as the output of the batch but instead I see the name of the machine where it runs followed by $.

Am I doing something wrong or is it a bug ?


Article Comments

In the sensor settings goto the "environment" section and select Set placeholders as environment values

The username will now showup as %prtg_windowsuser%

Batch file:

@echo off
echo 0:%prtg_windowsuser%
exit 0

Oct, 2015 - Permalink

Thanks for your answer but I was wondering how I could run a batch AS this user and not only use this info.


Oct, 2015 - Permalink

Hi BrunoZ

Hmm. You could use either RUNAS command in the batch, if its possible to use the switch /savecred
or
using psexec from sysinternals (Microsoft) to do so.

Maybe Paessler has a builtin solution.

regards Thomas


Oct, 2015 - Permalink