Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabling UAC with Powershell

Tags:

powershell

uac

I'm trying to disable UAC (i.e. set to the minimum level) using Powershell. So I'm running:

Set-ItemProperty -Path REGISTRY::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableLUA -Value 0

I've also tried this with -Force added on the end.

This code has the intended effect of setting UAC to minimum but also the undesired effect of preventing built-in Windows applications (including Edge) from running, returning an error that the application can't be run using the built-in administrator account (despite the fact that it's being run with a user account that simply has UAC disabled).

So if anyone has some insight as to why this is happening and how to resolve it, that would be ideal. Failing that, if there's an alternative Powershell command I can run to disable UAC then that could also be worth a shot.

like image 265
Sam Avatar asked Jun 07 '17 09:06

Sam


People also ask

How do I disable a user account in PowerShell?

You can also disable the Active Directory account using the PowerShell cmdlet Disable-ADAccount. In order to prompt the account disabling confirmation, you can add the –Confirm parameter. Distinguished Name; GUID (objectGUID);

How do I disable UAC for a specific program?

On your desktop, right click and select New > Shortcut. Paste 'C:\Windows\System32\schtasks.exe /RUN /TN "Name of folder\Name of task" into the text box. This will create a link to your program that will automatically skip the prompt asking for permission to make changes to your computer.


1 Answers

Looks like this did the trick:

Set-ItemProperty -Path REGISTRY::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -Name ConsentPromptBehaviorAdmin -Value 0

Edge still running after reboot and annoying UAC prompts gone, so think that's a win.

like image 68
Sam Avatar answered Oct 19 '22 20:10

Sam