Enumerate administrator accounts on elevation
Énumérer les comptes d’administrateur aux privilèges élevés
Explanation
This policy setting controls whether administrator accounts are displayed when a user attempts to elevate a running application. By default, administrator accounts are not displayed when the user attempts to elevate a running application.
If you enable this policy setting, all local administrator accounts on the PC will be displayed so the user can choose one and enter the correct password.
If you disable this policy setting, users will always be required to type a user name and password to elevate.
Ce paramètre de stratégie détermine si les comptes Administrateur s’affichent lorsqu’un utilisateur tente d’élever une application en cours d’exécution. Par défaut, les comptes Administrateur ne s’affichent pas lorsque l’utilisateur tente d’élever une application en cours d’exécution.
Si vous activez ce paramètre de stratégie, tous les comptes Administrateur locaux de cet ordinateur s’affichent pour permettre à l’utilisateur d’en choisir un et d’entrer le mot de passe correspondant.
Si vous désactivez ce paramètre de stratégie, les utilisateurs devront toujours entrer un nom d’utilisateur et un mot de passe pour avoir des privilèges élevés.
Registry
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\CredUI- Value name
EnumerateAdministrators
| State | Value written |
|---|---|
| Enabled | REG_DWORD = 1 |
| Disabled | REG_DWORD = 0 |
PowerShell
PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.
Writing directly to the registry bypasses Group Policy: if a GPO manages this value, it will be rewritten at the next gpupdate; otherwise the value stays in place (the "tattooing" effect). Prefer a GPO or, locally, LGPO.exe. Run PowerShell as administrator for HKLM. Some policies need a restart or gpupdate /force.
Enable
# Enable: CredUI/EnumerateAdministrators
$k = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\CredUI'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'EnumerateAdministrators' -Value 1 -Type DWordDisable
# Disable: CredUI/EnumerateAdministrators
$k = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\CredUI'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'EnumerateAdministrators' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": CredUI/EnumerateAdministrators
$k = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\CredUI'
Remove-ItemProperty -Path $k -Name 'EnumerateAdministrators' -ErrorAction SilentlyContinue