Disabling UAC with Powershell

南笙酒味 提交于 2019-12-11 01:48:12

问题


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.


回答1:


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.




回答2:


This is an issue specifically with Windows 10 and Windows 8. You cannot have Minimal/No UAC and be a local administrator on the machine. This actually affects more than just Edge including all modern apps like the Calculator as well. This was changed due to a security risk, as running the browser as an administrator is actually a really bad and insecure thing to do. Take a look at this article for more information

Via GPO, if you enable "Admin Approval Mode", you will then be able to launch apps without UAC but this comes with some drawbacks as well.

At my company, we put this in a GPO for a specific OU and dropped all Win10/Win8 devices into it so that the admin approval affects as few devices as possible.

You notice that it works when disabled by the GUI because you cannot disable UAC completely with the GUI, the only way to do it is with the registry key. So even though you think you're disabling it via the GUI, you're not disabling it completely.



来源:https://stackoverflow.com/questions/44409006/disabling-uac-with-powershell

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!