Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ismits
Created July 3, 2019 11:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ismits/ea44112d5a1c2ea09afec3eda4a6b249 to your computer and use it in GitHub Desktop.
Save ismits/ea44112d5a1c2ea09afec3eda4a6b249 to your computer and use it in GitHub Desktop.
Disable UAC via PowerShell
function Disable-UAC
{
Write-Log "Disabling User Access Control (UAC)..."
$RegPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"
New-RegKey $RegPath
Write-Log (New-ItemProperty -Path $RegPath -Name "EnableLUA" -Value 0 -PropertyType "DWORD" -Force)
Write-Log (New-ItemProperty -Path $RegPath -Name "ConsentPromptBehaviorAdmin" -Value 0 -PropertyType "DWORD" -Force)
Write-Log ("Disabling User Access Control (UAC) complete.")
return $true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment