Is there a way to get the UAC status(including level) in windows 7 computer using powershell?
(Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System).EnableLUA
will tell u if UAC is enabled or not.
The UAC level is recorded in system register keys. You can use the code below to get them.
$Key = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"
$ConsentPromptBehaviorAdmin_Name = "ConsentPromptBehaviorAdmin"
$PromptOnSecureDesktop_Name = "PromptOnSecureDesktop"
$ConsentPromptBehaviorAdmin_Value = Get-RegistryValue $Key $ConsentPromptBehaviorAdmin_Name
$PromptOnSecureDesktop_Value = Get-RegistryValue $Key $PromptOnSecureDesktop_Name
Different combinations between $ConsentPromptBehaviorAdmin_Value and $PromptOnSecureDesktop_Valued defines the UAC level.
For the complete sample, you can refer to https://gallery.technet.microsoft.com/How-to-switch-UAC-level-0ac3ea11
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With