I have an automation that stops a windows service using the invoke powershell activity. I have the robot installed in service mode . I enabled the troubleshoot setting to run the automation in assistant and the automation runs successfully as shown in the following screenshot
So I had UiPath installed on the server in attended mode and when i ran UiPath assistant as admin and ran the automation from orchestrator it works but when I installed it in service mode it and run from orchestrator it gives this error. It relates to the way it invokes the powershell command. You need to invoke it as an admin which it does in attended mode but not in service mode. If I run the command using -verb runAs to run it as an admin it require me to click yes for the User Account Control pop up which the robot cant do
To run UiPath service as Admin, we make below changes in policies:-
Run gpedit.msc to open the Local Group Policy Editor. Expand Computer Configuration, Windows Settings, Security Settings, Local Policies, and Security Options.
Set “User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode” to Elevate without prompting.
Set “User Account Control: Detect application installations and prompt for elevation” to Disabled.
Set “User Account Control: Run all administrators in Admin Approval Mode” to Disabled.
Set “User Account Control: Only elevate UIAccess applications that are installed in secure locations” to Disabled
This is the difference between running it from studio and running it in service mode. Studio opens powershell as admin with no UAC but if i run it in service mode it just opens it up as normal even though both have admin rights.