Configure maintenance windows for automatic updates
Configurer les fenêtres de maintenance pour les mises à jour automatiques
Explanation
Enable this policy to specify repeatable maintenance windows for the device to perform specified update actions.
When this policy is enabled, Windows Update will only perform the specified update action during the configured maintenance window. Specified update actions outside maintenance window will be deferred until the next maintenance window begins.
• Update Actions: Select which update actions are only allowed during maintenance window. If an update action is not selected, that action can happen outside of maintenance window.
- Download, install, and restart: Complete update cycle including download, installation, and system restart
- Install and restart: Install already downloaded updates and restart the device
- Restart only: Only perform a system restart for pending updates
• Basic Schedule Configuration:
- Start Date: Specify the initial date when the first maintenance window begins (format: yyyy-mm-dd, example: 2025-10-30)
* Start Date field only takes effect if Recurring schedule is set to “None”
- Start Time: Set the time when the maintenance window starts (format: hh:mm, example: 23:30 for 11:30 PM)
- Duration: Define how long each maintenance window lasts in hours (example: 2 for a 2-hour window)
• Recurring Schedule Options:
- No repeat: One-time maintenance window on the specified start date only
- Daily: Maintenance window will be repeated every day
- Weekly: Maintenance window will be repeated weekly on selected days of the week
- Monthly: Maintenance window will be repeated monthly on a specific day
• Weekly Schedule Settings (when Weekly is selected):
- Day of the week Selection: Choose which days of the week the maintenance window occurs:
* Sunday through Saturday: Check boxes to select specific day(s) of the week for the maintenance window
• Monthly Schedule Settings (when Monthly is selected):
- Monthly Schedule Type:
* Date-based: Maintenance window occurs on a specific day of the month (example: 15th day of each month)
* Week-based: Maintenance window occurs on a specific weekday occurrence within the month (example: 2nd Tuesday of each month)
* Last day of the month: Maintenance window occurs on the last day of the month
- Day of Month: When using date-based scheduling, specify which day of the month (1-28)
- Occurrence in Month: When using week-based scheduling, select which week of the month (First, Second, Third, Fourth, or Last)
- Day of the Week: When using week-based scheduling, select which day of the week (Sunday through Saturday)
Examples of Monthly Configurations:
- Date-based: "3rd day of every month" = Day of Month: 3
- Week-based: "Second Tuesday of every month" = Occurrence: Second, Day of Week: Tuesday
- Week-based: "Last Friday of every month" = Occurrence: Last, Day of Week: Friday
- Last day of the month: "Last day of every month"
After a non-repeating maintenance window occurs, the next maintenance window must be scheduled in 3 months. If the start date of a non-repeating maintenance window is more than 3 months in the past, this policy will be disregarded, and updates will be scheduled according to default settings.
If you disable or do not configure this policy, Windows Update will follow its default scheduling behavior.
Activez cette stratégie pour spécifier des fenêtres de maintenance reproductibles, afin que l’appareil effectue des actions de mise à jour spécifiées.
Lorsque cette stratégie est activée, Windows Update effectue uniquement l’action de mise à jour spécifiée pendant la fenêtre de maintenance configurée. Les actions de mise à jour spécifiées en dehors de la fenêtre de maintenance sont différées jusqu’au début de la fenêtre de maintenance suivante.
• Actions de mise à jour : sélectionnez les actions de mise à jour uniquement autorisées pendant la fenêtre de maintenance. Si une action de mise à jour n’est pas sélectionnée, cette action peut se produire en dehors de la fenêtre de maintenance.
- Télécharger, installer et redémarrer : terminez le cycle de mise à jour, y compris le téléchargement, l’installation et le redémarrage du système
- Installer et redémarrer : installer les mises à jour déjà téléchargées, puis redémarrer l’appareil
- Redémarrer uniquement : effectuer uniquement un redémarrage du système pour les mises à jour en attente
• Configuration de planification de base :
- Date de début : spécifier la date initiale de début de la première fenêtre de maintenance (format : aaaa-mm-jj, par exemple : 2025-10-30)
* Le champ Date de début prend effet uniquement si la planification périodique est définie sur « Aucune »
- Heure de début : définir l’heure à laquelle la fenêtre de maintenance démarre (format : hh:mm, par exemple : 23:30 pour 23 h 30)
- Durée : définir la durée pendant laquelle chaque fenêtre de maintenance dure, en heures (par exemple : 2 pour une fenêtre de 2 heures)
• Options de planification périodique :
- Aucune répétition : fenêtre de maintenance unique à la date de début spécifiée uniquement
- Quotidienne : la fenêtre de maintenance est répétée tous les jours
- Hebdomadaire : la fenêtre de maintenance est répétée toutes les semaines lors des jours sélectionnés
- Mensuelle : la fenêtre de maintenance est répétée tous les mois lors d’un jour spécifique
• Paramètres de planification hebdomadaire (lorsque Hebdomadaire est sélectionnée) :
- Sélection du jour de la semaine : choisir les jours de la semaine où la fenêtre de maintenance se produit :
* Dimanche à samedi : cocher les cases pour sélectionner le ou les jours spécifiques de la semaine pour la fenêtre de maintenance
• Paramètres de planification mensuelle (lorsque Mensuelle est sélectionnée) :
- Type de planification mensuelle :
* À une date spécifique : la fenêtre de maintenance se produit un jour spécifique du mois (par exemple : le 15e jour de chaque mois)
* Basée sur une semaine : la fenêtre de maintenance se produit lors d’un jour de la semaine spécifique au cours du mois (par exemple : 2e mardi de chaque mois)
* Dernier jour du mois : la fenêtre de maintenance se produit le dernier jour du mois
- Jour du mois : lors de l’utilisation de la planification basée sur les dates, spécifiez le jour du mois (1 à 28)
- Occurrence durant le mois : lors de l’utilisation de la planification basée sur une semaine, sélectionnez la semaine du mois (première, deuxième, troisième, quatrième ou dernière)
- Jour de la semaine : lorsque vous utilisez la planification basée sur la semaine, sélectionnez le jour de la semaine (du dimanche au samedi)
Exemples de configurations mensuelles :
- À une date spécifique : « 3e jour de chaque mois » = Jour du mois : 3
- Basée sur une semaine : « Deuxième mardi de chaque mois » = Occurrence : deuxième, Jour de la semaine : mardi
- Basée sur une semaine : « Dernier vendredi de chaque mois » = Occurrence : dernière, Jour de la semaine : vendredi
- Dernier jour du mois : « Dernier jour de chaque mois »
Suite à une fenêtre de maintenance qui ne se répète pas, la fenêtre de maintenance suivante doit être planifiée dans 3 mois. Si la date de début d’une fenêtre de maintenance non récurrente remonte à plus de 3 mois, cette stratégie est ignorée et les mises à jour sont planifiées en fonction des paramètres par défaut.
Si vous désactivez ou ne configurez pas cette stratégie, Windows Update poursuit son comportement de planification par défaut.
Use cases
Defines recurring maintenance windows during which only the selected update actions are allowed; outside the window they are deferred to the next one. It suits servers and production machines with strict time slots.
Microsoft generally recommends using either deadlines or maintenance windows, not both: a window overrides a deadline, except that an expired deadline forces updates outside the window.
Microsoft source: Enforcing compliance deadlines for updates
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate- Value name
MaintenanceWindowEnabled
| 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/MaintenanceWindow
$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 'MaintenanceWindowEnabled' -Value 1 -Type DWord
# Update actions only allowed inside the maintenance window
# Possible options:
# Download, install, and restart = 1
# Install and restart = 2
# Restart only = 3
Set-ItemProperty -Path $k -Name 'MaintenanceWindowUpdateActions' -Value 2 -Type DWord
# Start date (Format: yyyy-mm-dd example: 2025-10-30)
Set-ItemProperty -Path $k -Name 'MaintenanceWindowStartDate' -Value '<value>' -Type String
# Start time (Format: hh:mm example: 23:30 for 11:30 PM)
Set-ItemProperty -Path $k -Name 'MaintenanceWindowStartTime' -Value '<value>' -Type String
# Duration (hours)
Set-ItemProperty -Path $k -Name 'MaintenanceWindowDurationHours' -Value 2 -Type DWord # between 2 and 24
# Select repeat schedule
# Possible options:
# No repeat = 1
# Daily = 2
# Weekly = 3
# Monthly = 4
Set-ItemProperty -Path $k -Name 'MaintenanceWindowRepeatScheduleOption' -Value 2 -Type DWord
# Sunday
# value not defined in the ADMX (the GPO editor usually writes 1/0)
# 1 = checked, 0 = unchecked; default state taken from the ADML
Set-ItemProperty -Path $k -Name 'MaintenanceWindowWeeklySunday' -Value 0 -Type DWord
# Monday
Set-ItemProperty -Path $k -Name 'MaintenanceWindowWeeklyMonday' -Value 0 -Type DWord # value not defined in the ADMX; 1 = checked, 0 = unchecked
# Tuesday
Set-ItemProperty -Path $k -Name 'MaintenanceWindowWeeklyTuesday' -Value 0 -Type DWord # value not defined in the ADMX; 1 = checked, 0 = unchecked
# Wednesday
Set-ItemProperty -Path $k -Name 'MaintenanceWindowWeeklyWednesday' -Value 0 -Type DWord # value not defined in the ADMX; 1 = checked, 0 = unchecked
# Thursday
Set-ItemProperty -Path $k -Name 'MaintenanceWindowWeeklyThursday' -Value 0 -Type DWord # value not defined in the ADMX; 1 = checked, 0 = unchecked
# Friday
Set-ItemProperty -Path $k -Name 'MaintenanceWindowWeeklyFriday' -Value 0 -Type DWord # value not defined in the ADMX; 1 = checked, 0 = unchecked
# Saturday
Set-ItemProperty -Path $k -Name 'MaintenanceWindowWeeklySaturday' -Value 0 -Type DWord # value not defined in the ADMX; 1 = checked, 0 = unchecked
# Monthly Schedule Type
# Possible options:
# Date-based = 1
# Week-based = 2
# Last day of the month = 3
Set-ItemProperty -Path $k -Name 'MaintenanceWindowMonthlySchedule' -Value 2 -Type DWord
# Day of the Month
Set-ItemProperty -Path $k -Name 'MaintenanceWindowMonthlyMonthBasedDayOfMonth' -Value 1 -Type DWord # between 1 and 28
# Occurrence in Month
# Possible options:
# First = 1
# Second = 2
# Third = 3
# Fourth = 4
# Last = 5
Set-ItemProperty -Path $k -Name 'MaintenanceWindowMonthlyWeekBasedOccurrenceInMonth' -Value 2 -Type DWord
# Day of the Week
# Possible options:
# Sunday = 1
# Monday = 2
# Tuesday = 3
# Wednesday = 4
# Thursday = 5
# Friday = 6
# Saturday = 7
Set-ItemProperty -Path $k -Name 'MaintenanceWindowMonthlyWeekBasedDayOfTheWeek' -Value 2 -Type DWordDisable
# Disable: WindowsUpdate/MaintenanceWindow
$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 'MaintenanceWindowEnabled' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": WindowsUpdate/MaintenanceWindow
$k = 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate'
Remove-ItemProperty -Path $k -Name 'MaintenanceWindowEnabled' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'MaintenanceWindowUpdateActions' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'MaintenanceWindowStartDate' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'MaintenanceWindowStartTime' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'MaintenanceWindowDurationHours' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'MaintenanceWindowRepeatScheduleOption' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'MaintenanceWindowWeeklySunday' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'MaintenanceWindowWeeklyMonday' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'MaintenanceWindowWeeklyTuesday' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'MaintenanceWindowWeeklyWednesday' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'MaintenanceWindowWeeklyThursday' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'MaintenanceWindowWeeklyFriday' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'MaintenanceWindowWeeklySaturday' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'MaintenanceWindowMonthlySchedule' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'MaintenanceWindowMonthlyMonthBasedDayOfMonth' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'MaintenanceWindowMonthlyWeekBasedOccurrenceInMonth' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'MaintenanceWindowMonthlyWeekBasedDayOfTheWeek' -ErrorAction SilentlyContinueOptions (16)
| Label | Control | Registry value | REG type | Constraints / details | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Update actions only allowed inside the maintenance window:Actions de mise à jour autorisées uniquement dans la fenêtre de maintenance :MaintenanceWindowUpdateActionsID | Drop-down listenum | MaintenanceWindowUpdateActions | REG_DWORD | Required · Default choice (UI): #1
| ||||||||||||||||
| Start date (Format: yyyy-mm-dd example: 2025-10-30)Date de début (format : jj-mm-aaaa, exemple : 30-10-2025)MaintenanceWindowStartDateID | Text boxtext | MaintenanceWindowStartDate | REG_SZ | |||||||||||||||||
| Start time (Format: hh:mm example: 23:30 for 11:30 PM)Heure de début (format : hh:mm, exemple : 23:30 pour 23h30)MaintenanceWindowStartTimeID | Text boxtext | MaintenanceWindowStartTime | REG_SZ | |||||||||||||||||
| Duration (hours):Durée (heures) :MaintenanceWindowDurationHoursID | Numeric boxdecimal | MaintenanceWindowDurationHours | REG_DWORD | Required · Min: 2 · Max: 24 · Default (UI): 2 | ||||||||||||||||
| Select repeat schedule:Sélectionnez la planification de répétition :MaintenanceWindowRepeatScheduleOptionID | Drop-down listenum | MaintenanceWindowRepeatScheduleOption | REG_DWORD | Required · Default choice (UI): #1
| ||||||||||||||||
| SundayDimancheMaintenanceWindowWeeklySundayID | Check boxboolean | MaintenanceWindowWeeklySunday | REG_DWORD | Default (UI): false Checked: implicit: 1Unchecked: implicit: 0 | ||||||||||||||||
| MondayLundiMaintenanceWindowWeeklyMondayID | Check boxboolean | MaintenanceWindowWeeklyMonday | REG_DWORD | Default (UI): false Checked: implicit: 1Unchecked: implicit: 0 | ||||||||||||||||
| TuesdayMardiMaintenanceWindowWeeklyTuesdayID | Check boxboolean | MaintenanceWindowWeeklyTuesday | REG_DWORD | Default (UI): false Checked: implicit: 1Unchecked: implicit: 0 | ||||||||||||||||
| WednesdayMercrediMaintenanceWindowWeeklyWednesdayID | Check boxboolean | MaintenanceWindowWeeklyWednesday | REG_DWORD | Default (UI): false Checked: implicit: 1Unchecked: implicit: 0 | ||||||||||||||||
| ThursdayJeudiMaintenanceWindowWeeklyThursdayID | Check boxboolean | MaintenanceWindowWeeklyThursday | REG_DWORD | Default (UI): false Checked: implicit: 1Unchecked: implicit: 0 | ||||||||||||||||
| FridayVendrediMaintenanceWindowWeeklyFridayID | Check boxboolean | MaintenanceWindowWeeklyFriday | REG_DWORD | Default (UI): false Checked: implicit: 1Unchecked: implicit: 0 | ||||||||||||||||
| SaturdaySamediMaintenanceWindowWeeklySaturdayID | Check boxboolean | MaintenanceWindowWeeklySaturday | REG_DWORD | Default (UI): false Checked: implicit: 1Unchecked: implicit: 0 | ||||||||||||||||
| Monthly Schedule Type:Type de planification mensuelle :MaintenanceWindowMonthlyScheduleID | Drop-down listenum | MaintenanceWindowMonthlySchedule | REG_DWORD | Required · Default choice (UI): #1
| ||||||||||||||||
| Day of the Month:Jour du mois :MaintenanceWindowMonthlyMonthBasedDayOfMonthID | Numeric boxdecimal | MaintenanceWindowMonthlyMonthBasedDayOfMonth | REG_DWORD | Required · Min: 1 · Max: 28 · Default (UI): 1 | ||||||||||||||||
| Occurrence in MonthOccurrence dans le moisMaintenanceWindowMonthlyWeekBasedOccurrenceInMonthID | Drop-down listenum | MaintenanceWindowMonthlyWeekBasedOccurrenceInMonth | REG_DWORD | Required · Default choice (UI): #1
| ||||||||||||||||
| Day of the WeekJour de la semaineMaintenanceWindowMonthlyWeekBasedDayOfTheWeekID | Drop-down listenum | MaintenanceWindowMonthlyWeekBasedDayOfTheWeek | REG_DWORD | Required · Default choice (UI): #1
|