Does anyone know of a way to Invoke PowerShell as a user other than the user the robot is running as (similar to Run as Different User)?
I need to do some AD and Exchange work with variables created in UiPath. The process works fine if I run in Studio while logged in with an AD admin account but we don’t (and won’t) have a robot running under those credentials.
The only way I can come up with is use Invoke Code to start PowerShell with different credentials (from Orchestrator) and passing it a PS script along with the UiPath variables as arguments. Should work but seems messier than it needs to be.
I guess it would be helpful if I followed up with how I handled. It’s ugly but didn’t find a better way. This was for creating a new AD user, adding to groups, creating a new session to Exchange, and adding a user.
I read that post and the difference was I needed to run PS as a different user, not elevate the current user to admin.
I used Invoke Code Invoke Code to start PS with the different account and then called the PS script with the variables located in the argument collection.