Use PDIs? Take our 5-minute survey to help shape the PDI roadmap.

MID Server Script File Runas

Emanuele Zof
Tera Guru

Hi all,

 

is it possible to execute a MID Server Script File as an other user (like runas on shell)?

 

Script is powershell created on: MID Server > Script Files

 

Thanks for the help.

1 ACCEPTED SOLUTION

Emanuele Zof
Tera Guru

Thank you all.

 

We finally figured it out: instead of running the script directly, we ran a scheduled task that, in turn, executes the script with another user's privileges.

 

Example:

var task = 'name-of-scheduled-task';
ecc.payload = '<?xml version="1.0" encoding="UTF-8"?><parameters><parameter name="name" value="C:\\Windows\\System32\\schtasks.exe /run /tn &quot;'+task+'&quot;"/><parameter name="skip_sensor" value="true"/></parameters>';

View solution in original post

4 REPLIES 4

Nilesh Pol
Kilo Sage

@Emanuele Zof Yes, it is possible to execute a PowerShell script from MID Server > Script Files as another user, though it requires specific configuration because the MID Server service normally runs scripts using its own service account.

Great, what settings should I adjust, and where can I do that?

Tanushree Maiti
Tera Patron

Emanuele Zof
Tera Guru

Thank you all.

 

We finally figured it out: instead of running the script directly, we ran a scheduled task that, in turn, executes the script with another user's privileges.

 

Example:

var task = 'name-of-scheduled-task';
ecc.payload = '<?xml version="1.0" encoding="UTF-8"?><parameters><parameter name="name" value="C:\\Windows\\System32\\schtasks.exe /run /tn &quot;'+task+'&quot;"/><parameter name="skip_sensor" value="true"/></parameters>';