Run Powershell script with another user and not MidServer user

Najmuddin Mohd
Mega Sage

Hello,

We are trying to trigger a PowerShell script from ServiceNow.
The PowerShell Script is written on the Server which reset the password of the AD User.

But, the PowerShell script runs with the MidServer user who has only Log on as Service, it does not have any privileges to run the command and we are getting the error as User does not have access.

We want to run the PowerShell command with a user who has access to run script and not as MidServer user. We will store the user credentials in ServiceNow.

How this can be achived?


Regards,
Najmuddin

5 REPLIES 5

Kieran Anson
Kilo Patron

Hi,

This'll depend on how you're triggering the script. Is this via Flow + Integration Hub? 

No, just insert the record in the ECC queue.

VivekSattanatha
Mega Sage

In your script if you pass $cred parameter it will take the credential from Servicenow credential table. Something like this

VivekSattanatha_0-1762962157019.png

 

Can you please give any reference record from the ServiceNow, I will try this.