How do I disable UAC using Windows PowerShell?

Chris Ballance picture Chris Ballance · Mar 5, 2012 · Viewed 32k times · Source

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.

Answer

David Brabant picture David Brabant · Mar 5, 2012
New-ItemProperty -Path HKLM:Software\Microsoft\Windows\CurrentVersion\policies\system -Name EnableLUA -PropertyType DWord -Value 0 -Force
Restart-Computer