
Question:
Is there a way to get the UAC status(including level) in windows 7 computer using powershell?
Solution:1
(Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System).EnableLUA
will tell u if UAC is enabled or not.
Solution:2
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
Solution:3
@ravikanth already posted a good answer, but for those exploring other options here are two other ways to get the same info in different way:
Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableLUA
or
Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableLUA | Select-Object EnableLUA
Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
EmoticonEmoticon