Open in the explorer

Require a password when a computer wakes (plugged in)

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

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/ACPromptForPasswordOnResume_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.

Use cases

Requires a password when the computer wakes from sleep while plugged in: the system returns to the secure desktop instead of reopening the session. Enabled or not configured, the password is requested; disabled, the session resumes without any new authentication, which leaves a stolen or unattended machine exploitable.

Microsoft states that the behaviour is on by default on desktop editions of Windows; it was not always on in some editions of Windows 8.1 and earlier. The same logic exists for battery operation: configure both variants, so that a laptop does not unlock its screen on wake while on battery.

Microsoft source: Prompt for password on resume

Registry

HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51
Value name
ACSettingIndex
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/ACPromptForPasswordOnResume_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 'ACSettingIndex' -Value 1 -Type DWord

Disable

# Disable: Power/ACPromptForPasswordOnResume_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 'ACSettingIndex' -Value 0 -Type DWord

Revert to "Not configured"

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

Availability