Interactive logon: Prompt user to change password before expiration: registry value PasswordExpiryWarningComputerHKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon

Category
Security Settings › Local Policies › Security Options
Scope
Computer Configuration
Source
Windows 11 (version 26H2 · 26300.9457)

Registry

PasswordExpiryWarning

REG_DWORDComputer
Enabled value
Depends on the option value
Element
Interactive logon: Prompt user to change password before expiration
Value type
REG_DWORD
Apply with .reg · CMD · PowerShell
.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon]
"PasswordExpiryWarning"=dword:<enter value>
CMD
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "PasswordExpiryWarning" /t REG_DWORD /d "<enter value>" /f
PowerShell
New-Item -Path 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' -Force | Out-Null
New-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name 'PasswordExpiryWarning' -PropertyType DWord -Value '<enter value>' -Force | Out-Null