How do I disable UAC using a PowerShell script? I can do this manually via the registry using the adding the following registry entry
Key: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA
Value: 0
Type: DWORD
The script should account for the possibility that this key is already present and set incorrectly.
1 – Add the following two functions to your PowerShell profile (
C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1)2 – Run
Disable-UACin PowerShell3 – Reboot for changes to take effect. Using PowerShell, this would be
Restart-Computer -Force -Confirm:$false