ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

How to run elevated commands without disabling UAC

book

Article ID: 88414

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine

Issue/Introduction

Some jobs that run e.g. Powershell as administrator requires a UAC prompt.
If disabling UAC or mimic disabling UAC on host (set "User Account Control: Run all administrators in Admin Approval Mode" to "Disabled") is not an option on your company, then you can try some options below. 


Please note that this is outside of Automic Support's scope so you will need to tweak/test the steps below to fit your environment.

Environment

Release: AUTWAB99000-11.0-Automic Workload Automation-Base Edition
Component:

Resolution


Option A: Use the -Verb parameter of the Start-Process powershell command to run the process as admin
Link: http://ss64.com/ps/syntax-elevate.html
 
Option B: Add the executable to the Task Scheduler
Link: http://lifehacker.com/how-to-eliminate-uac-prompts-for-specific-applications-493128966 

 
Example for Powershell 1.0 ---
1) In Task Scheduler, right-click "Task Scheduler Library" and select "New Folder" Name it whatever you would like.

2) Select the new folder and click "Create Task" (not "Create Basic Task")

3) Name the task something descriptive. Enable "Run with highest privileges," and select your OS under "Configure for."

4) Under the Actions tab, select "Start a program" in the Action dropdown if it isn't already. Click Browse and find your app's .exe file (usually 4) under Program Files on your C: drive).

5) (Laptops) Under Conditions tab, deselect "Start the task only if the computer is on AC power."

6) On your desktop, right click and select New > Shortcut.

7) Paste 'C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe  /RUN /TN "Name of folder\Name of task" into the text box.