No auto-restart with logged on users for scheduled automatic updates installations
Pas de redémarrage automatique avec des utilisateurs connectés pour les installations planifiées de mises à jour automatiques
Explanation
Specifies that to complete a scheduled installation, Automatic Updates will wait for the computer to be restarted by any user who is logged on, instead of causing the computer to restart automatically.
If the status is set to Enabled, Automatic Updates will not restart a computer automatically during a scheduled installation if a user is logged in to the computer. Instead, Automatic Updates will notify the user to restart the computer.
Be aware that the computer needs to be restarted for the updates to take effect.
If the status is set to Disabled or Not Configured, Automatic Updates will notify the user that the computer will automatically restart in 5 minutes to complete the installation.
Note: This policy applies only when Automatic Updates is configured to perform scheduled installations of updates. If the "Configure Automatic Updates" policy is disabled, this policy has no effect.
Spécifie que pour terminer une installation planifiée, le service Mises à jour automatiques va attendre le prochain démarrage de l’ordinateur par un utilisateur connecté au lieu de provoquer un démarrage automatique.
Si le statut est configuré à Activé, le service Mises à jour automatiques ne va pas redémarrer un ordinateur automatiquement pendant une installation planifiée si un utilisateur est connecté à l’ordinateur. Il invitera simplement l’utilisateur à redémarrer l’ordinateur.
N’oubliez pas qu’un redémarrage de l’ordinateur est nécessaire pour que les mises à jour soient effectives.
Si le statut est configuré à Désactivé ou Non configuré, le service Mises à jour automatiques va avertir l’utilisateur que l’ordinateur va redémarrer dans 5 minutes pour terminer l’installation.
Remarque : cette stratégie s’applique uniquement lorsque le service Mises à jour automatiques est configuré pour effectuer des installations planifiées de mises à jour. Si la stratégie « Configuration du service Mises à jour automatiques » est désactivée, cette stratégie n’a aucun effet.
Use cases
This setting prevents automatic restarts while a user is signed in (only active RDP sessions count) and only applies when Configure Automatic Updates is set to option 4. It is tempting on machines where you want to avoid losing work in progress.
Microsoft warns that because many users never sign out, quality updates may never finish installing. The recommended replacement is a compliance deadline combined with the no-auto-restart options; on servers, prefer option 7.
Microsoft sources: Manage device restarts after updates · Step 4: Configure Group Policy settings for automatic updates
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\AU- Value name
NoAutoRebootWithLoggedOnUsers
| 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: WindowsUpdate/NoAutoRebootWithLoggedOnUsers_Title
$k = 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\AU'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'NoAutoRebootWithLoggedOnUsers' -Value 1 -Type DWordDisable
# Disable: WindowsUpdate/NoAutoRebootWithLoggedOnUsers_Title
$k = 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\AU'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'NoAutoRebootWithLoggedOnUsers' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": WindowsUpdate/NoAutoRebootWithLoggedOnUsers_Title
$k = 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\AU'
Remove-ItemProperty -Path $k -Name 'NoAutoRebootWithLoggedOnUsers' -ErrorAction SilentlyContinue