I'm trying to modify the permissions of the UAC with a powershell script that looks like:
Start-Process powershell -Verb runAs Administrator
Set-ItemProperty -Path registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system -Name EnableLUA -Value 0
$UAC = Get-ItemProperty -Path registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system -Name EnableLUA
$UAC.EnableLUA
Even though I am running the script as administrator, I still get the following error:
Set-ItemProperty : Requested registry access is not allowed. At C:\Users\Bert\Desktop\autoLims.ps1:8 char:17 + Set-ItemProperty <<<< -Path registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system -Name EnableLUA -Value 0 + CategoryInfo : PermissionDenied: (HKEY_LOCAL_MACH...policies\system:String) [Set-ItemProperty], SecurityException + FullyQualifiedErrorId : System.Security.SecurityException,Microsoft.PowerShell.Commands.SetItemPropertyCommand
Any ideas why it wont run the script even though I am running the script as administrator? Is there something else I need to change?
-Verb runAs
-- noAdministrator
– Andy Arismendi