Open in the explorer

Require a password when a computer wakes (on battery)

Demander un mot de passe lorsqu’un ordinateur sort de la veille (sur batterie)

Type
Computer
GPO path
Computer Configuration › Policies › Administrative Templates › System › Power Management › Sleep Settings FR: Configuration ordinateur › Stratégies › Modèles d'administration › Système › Gestion de l’alimentation › Paramètres de la veille
Supported on
At least Windows Vista FR: Au minimum Windows Vista
ADMX file
Power.admx
Internal name
Power/DCPromptForPasswordOnResume_2

Explanation

This policy setting specifies whether or not the user is prompted for a password when the system resumes from sleep.

If you enable or do not configure this policy setting, the user is prompted for a password when the system resumes from sleep.

If you disable this policy setting, the user is not prompted for a password when the system resumes from sleep.

French text from Windows 11 26H2

Ce paramètre de stratégie spécifie si l’utilisateur doit entrer un mot de passe lorsque le système sort de veille.

Si vous activez ou ne configurez pas ce paramètre de stratégie, l’utilisateur est invité à entrer un mot de passe lorsque le système sort de veille.

Si vous désactivez ce paramètre de stratégie, l’utilisateur n’est pas invité à entrer un mot de passe lorsque le système sort de veille.

Registry

HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51
Value name
DCSettingIndex
StateValue written
EnabledREG_DWORD = 1
DisabledREG_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: Power/DCPromptForPasswordOnResume_2
$k = 'HKLM:\Software\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'DCSettingIndex' -Value 1 -Type DWord

Disable

# Disable: Power/DCPromptForPasswordOnResume_2
$k = 'HKLM:\Software\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'DCSettingIndex' -Value 0 -Type DWord

Revert to "Not configured"

# Revert to "Not configured": Power/DCPromptForPasswordOnResume_2
$k = 'HKLM:\Software\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51'
Remove-ItemProperty -Path $k -Name 'DCSettingIndex' -ErrorAction SilentlyContinue

Availability