Sign-in and lock last interactive user automatically after a restart
Se connecter et verrouiller automatiquement le dernier utilisateur interactif après un redémarrage
Explanation
This policy setting controls whether a device will automatically sign in and lock the last interactive user after the system restarts or after a shutdown and cold boot.
This only occurs if the last interactive user didn’t sign out before the restart or shutdown.
If the device is joined to Active Directory or Azure Active Directory, this policy only applies to Windows Update restarts. Otherwise, this will apply to both Windows Update restarts and user-initiated restarts and shutdowns.
If you don’t configure this policy setting, it is enabled by default. When the policy is enabled, the user is automatically signed in and the session is automatically locked with all lock screen apps configured for that user after the device boots.
After enabling this policy, you can configure its settings through the ConfigAutomaticRestartSignOn policy, which configures the mode of automatically signing in and locking the last interactive user after a restart or cold boot.
If you disable this policy setting, the device does not configure automatic sign in. The user’s lock screen apps are not restarted after the system restarts.
Ce paramètre de stratégie contrôle si un appareil connecte et verrouille automatiquement le dernier utilisateur interactif après un redémarrage du système, un arrêt ou un démarrage à froid.
Cela ne se produit que si le dernier utilisateur interactif ne s'est pas déconnecté avant le redémarrage ou l'arrêt.
Si l'appareil est joint à Active Directory ou à Azure Active Directory, cette stratégie s'applique uniquement aux redémarrages de Windows Update. Sinon, elle s'applique aux redémarrages de Windows Update et aux redémarrages et arrêts initiés par l'utilisateur.
Si vous ne configurez pas ce paramètre de stratégie, il est activé par défaut. Lorsque la stratégie est activée, l'utilisateur est automatiquement connecté et la session est automatiquement verrouillée avec toutes les applications de l’écran de verrouillage configurées pour cet utilisateur après le démarrage du système.
Après l'activation de cette stratégie, vous pouvez configurer ses paramètres via la stratégie ConfigAutomaticRestartSignOn, qui configure le mode de connexion et de verrouillage automatique du dernier utilisateur interactif après un redémarrage ou un démarrage à froid.
Si vous désactivez ce paramètre de stratégie, l'appareil ne configure pas la connexion automatique. Les applications de l’écran de verrouillage de l’utilisateur ne sont pas redémarrées après le redémarrage du système.
Registry
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System- Value name
DisableAutomaticRestartSignOn
| State | Value written |
|---|---|
| Enabled | REG_DWORD = 0 |
| Disabled | REG_DWORD = 1 |
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: WinLogon/AutomaticRestartSignOn
$k = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'DisableAutomaticRestartSignOn' -Value 0 -Type DWordDisable
# Disable: WinLogon/AutomaticRestartSignOn
$k = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'DisableAutomaticRestartSignOn' -Value 1 -Type DWordRevert to "Not configured"
# Revert to "Not configured": WinLogon/AutomaticRestartSignOn
$k = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System'
Remove-ItemProperty -Path $k -Name 'DisableAutomaticRestartSignOn' -ErrorAction SilentlyContinue