How to run elevated commands without disabling UAC

Document ID : KB000088414
Last Modified Date : 14/04/2018
Show Technical Document Details
Issue:
Some jobs that run (eg)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.
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.