Open in the explorer

Specify active hours range for auto-restarts

Spécifier une plage d’heures d’activité pour les redémarrages automatiques

Type
Computer
GPO path
Computer Configuration › Policies › Administrative Templates › Windows Components › Windows Update › Manage end user experience FR: Configuration ordinateur › Stratégies › Modèles d'administration › Composants Windows › Windows Update › Gérer l’expérience utilisateur final
Supported on
At least Windows Server 2016 or Windows 10 FR: Au moins Windows Server 2016 ou Windows 10
ADMX file
WindowsUpdate.admx
Internal name
WindowsUpdate/ActiveHoursMaxRange

Explanation

Enable this policy to specify the maximum number of hours from the start time that users can set their active hours.

The max active hours range can be set between 8 and 18 hours.

If you disable or do not configure this policy, the default max active hours range will be used.

French text from Windows 11 26H2

Activez cette stratégie pour spécifier le nombre maximum d’heures pendant lesquelles les utilisateurs peuvent définir leurs heures d’activité à partir de l’heure de début.

La plage d’heures d’activité maximum peut aller de 8 à 18 heures.

Si vous désactivez cette stratégie ou si vous ne la configurez pas, la plage d’heures d’activité maximum par défaut sera utilisée.

Use cases

Caps how long a span users may declare as active hours, counted from the start time: 12 hours on Windows 10 1607 and Server 2016, 18 hours on later versions. It prevents users from declaring round-the-clock activity to avoid restarts.

For pre-1903 devices, Microsoft's recommended-values guidance suggests a maximum range of 10.

Microsoft sources: Manage device restarts after updates · Update policies

Registry

HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate
Value name
SetActiveHoursMaxRange
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: WindowsUpdate/ActiveHoursMaxRange
$k = 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'SetActiveHoursMaxRange' -Value 1 -Type DWord
# Max range
# Possible options:
#   8 = 8
#   9 = 9
#   10 = 10
#   11 = 11
#   12 = 12
#   13 = 13
#   14 = 14
#   15 = 15
#   16 = 16
#   17 = 17
#   18 = 18
Set-ItemProperty -Path $k -Name 'ActiveHoursMaxRange' -Value 18 -Type DWord

Disable

# Disable: WindowsUpdate/ActiveHoursMaxRange
$k = 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'SetActiveHoursMaxRange' -Value 0 -Type DWord

Revert to "Not configured"

# Revert to "Not configured": WindowsUpdate/ActiveHoursMaxRange
$k = 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate'
Remove-ItemProperty -Path $k -Name 'SetActiveHoursMaxRange' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'ActiveHoursMaxRange' -ErrorAction SilentlyContinue

Options (1)

LabelControlRegistry valueREG typeConstraints / details
Max range:Portée max. :ActiveHoursMaxRangeDrop-down listenumActiveHoursMaxRangeREG_DWORD
Required · Default choice (UI): #10
LabelValue
8REG_DWORD = 8
9REG_DWORD = 9
10REG_DWORD = 10
11REG_DWORD = 11
12REG_DWORD = 12
13REG_DWORD = 13
14REG_DWORD = 14
15REG_DWORD = 15
16REG_DWORD = 16
17REG_DWORD = 17
18REG_DWORD = 18

Availability