Do not allow password expiration time longer than required by policy
N’autorisez pas le délai d’expiration du mot de passe plus longtemps que ce qui est requis par la stratégie
Explanation
If this setting is enabled or not configured, planned password expiration longer than the password age dictated by the "Password Settings" policy is NOT allowed. When such expiration is detected, the password is changed immediately and password expiration is set according to policy.
If this setting is disabled, password expiration time may be longer than required by "Password Settings" policy.
See https://go.microsoft.com/fwlink/?linkid=2188435 for more information.
Si ce paramètre est activé ou n’est pas configuré, l’expiration planifiée du mot de passe dépasse l’âge dicté par la stratégie « Mot de passe Paramètres » n’est PAS autorisée. Lorsqu’une telle expiration est détectée, le mot de passe est modifié immédiatement et l’expiration du mot de passe est définie conformément à la stratégie.
Si ce paramètre est désactivé, le délai d’expiration du mot de passe peut être plus long que celui requis par la stratégie « Mot de passe Paramètres ».
Pour plus d’informations, consultez https://go.microsoft.com/fwlink/?linkid=2188435.
Use cases
Prevents setting a password expiration time further out than the policy requires (enabled by default in Windows LAPS). It keeps a hand-edited attribute from postponing rotation indefinitely.
In legacy LAPS emulation mode the default differs (disabled), so check it during migration.
Microsoft source: Configure policy settings for Windows LAPS
Registry
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS- Value name
PasswordExpirationProtectionEnabled
| 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: LAPS/LAPS_DontAllowPwdExpirationBehindPolicy
$k = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'PasswordExpirationProtectionEnabled' -Value 1 -Type DWordDisable
# Disable: LAPS/LAPS_DontAllowPwdExpirationBehindPolicy
$k = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'PasswordExpirationProtectionEnabled' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": LAPS/LAPS_DontAllowPwdExpirationBehindPolicy
$k = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS'
Remove-ItemProperty -Path $k -Name 'PasswordExpirationProtectionEnabled' -ErrorAction SilentlyContinue