Issues running script as another user

I am attempting to run a script in PowerShell Universal 1.3.0 as a different user. I entered a PSCredential secret variable, using the form DOMAIN\username for the user. I gave this user “Log on as a Batch Job” rights. (I also tried making it an admin on the server running PoshU - same result.) I also verified the password is correct.

The error I receive is: Error executing job: A required privilege is not held by the client.

PoshU is running under a dedicated service account, which is also an Administrator on the server.

Any idea what I might have done wrong?

Thanks,
Eric

Did you grant the service account the privileges listed here?

https://docs.ironmansoftware.com/config/running-as-a-service-account

Also, how are you hosting PSU? As a service or in IIS?

My apologies, I did read that page of the docs but misinterpreted it. I thought it was sufficient that my service account was a local Admin on the server. However, once I gave the account running PSU the three rights listed, it started working. Thanks for your help!

-Eric

1 Like