How to read "Computer Configuration\Policies\Windows Settings\Security Settings\Local Policies\Security Options" value?

280 views Asked by At

I want to read security settings value programmatically using command prompt and wmic.exe tool.

Specifically value "Computer Configuration\Policies\Windows Settings\Security Settings\Local Policies\Security Options\User Account Control: Run all administrators in Admin Approval Mode".

It's interesting also to disable it from console. I failed to find anything meaningful via Google. May Be someone knows how to read it? Solution using "...GetObject("winmgmts:...")" is also acceptable. Tnx in advance fror useful hints.

Reading of Windows security settings using cmd.exe.

1

There are 1 answers

0
kopiev On

I found the corresponding values in the registry, so the answer to the question is there and it is most likely closed. And the utility wmic.exe is not needed.

Might be useful to someone. Corresponding property values and registry values:

Settings location inside "secpol.msc": Computer Configuration\Policies\Windows Settings\Security Settings\Local Policies\Security Options\

Corresponding registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System

Legend:

  1. Settings item name without prefix "User Account Control" = Settings item value to be set
  2. Corresponding registry item name = Registry item value corresponding to needed settings value

Setting & registry value #1:

  1. Behavior of the elevation prompt for adminstrators in Admin Approval Mode = Elevate without prompting (Default value)
  2. ConsentPromptBehaviorAdmin = 0

Setting & registry value #2:

  1. Detect application installations and prompt for elevation = Disabled
  2. EnableInstallerDetection = 0

Setting & registry value #3:

  1. Only elevate UIAccess applications that are installed in secure locations = Disabled
  2. EnableSecureUIAPaths = 0

Setting & registry value #4:

  1. Run all administrators in Admin Approval Mode = Disabled
  2. EnableLUA = 0 (needs reboot)