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

I have a similar problem. PS Universal (3.8.12) runs in IIS, without a service account (nt authority\system). Run as different user brings the error:
[error] The ‘Out-PSUPipeline’ command was found in the module ‘Universal’, but the module could not be loaded. For more information, run ‘Import-Module Universal’.
We just run a simple Whoami in script, credentials are stored in BuiltInLocalVault
User has the privilege run as batch job and local admin permission.

Thanks for your help!