Specify deadline before auto-restart for update installation
Verified with Windows 11 25H2 — updated on July 30, 2026
Supported on: Windows Server 2016 through Windows Server 2022, or Windows 10
Path in the GPO console
Computer Configuration\Administrative Templates\Windows Components\Windows Update\Legacy Policies Description
Specify the deadline before the PC will automatically restart to apply updates. The deadline can be set 2 to 14 days past the default restart date. The restart may happen inside active hours. If you disable or do not configure this policy, the PC will restart according to the default schedule. Enabling either of the following two policies will override the above policy: 1. No auto-restart with logged on users for scheduled automatic updates installations. 2. Always automatically restart at scheduled time.
Registry
Software\Policies\Microsoft\Windows\WindowsUpdate Value name: SetAutoRestartDeadline
Enabled: SetAutoRestartDeadline = 1
Disabled: SetAutoRestartDeadline = 0
MDM / Intune (CSP)
./Device/Vendor/MSFT/Policy/Config/Update/AutoRestartDeadlinePeriodInDays Multiple CSP matches are possible; the first one was selected.
Microsoft Learn documentation Mapping data: Microsoft Learn (CC BY 4.0)
Export Builder
BETAConfigure the state, scope and options, then generate .reg, PowerShell, Intune and SCCM outputs — or add the setting to a multi-setting collection.
These exports write the registry — this is not a managed GPO. ⓘ
.reg file
Windows Registry Editor Version 5.00
; Exported from gporais.com
; Policy: Specify deadline before auto-restart for update installation
; State: Enabled
; Supported on: Windows Server 2016 through Windows Server 2022, or Windows 10
[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate]
"SetAutoRestartDeadline"=dword:00000001
"AutoRestartDeadlinePeriodInDays"=dword:00000007
"AutoRestartDeadlinePeriodInDaysForFeatureUpdates"=dword:00000007 More formats (PowerShell, Intune, SCCM)
PowerShell
# Exported from gporais.com
# Policy: Specify deadline before auto-restart for update installation
# State: Enabled
# Supported on: Windows Server 2016 through Windows Server 2022, or Windows 10
$path = 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate'
New-Item -Path $path -Force | Out-Null
Set-ItemProperty -Path $path -Name 'SetAutoRestartDeadline' -Value 1 -Type DWord
Set-ItemProperty -Path $path -Name 'AutoRestartDeadlinePeriodInDays' -Value 7 -Type DWord
Set-ItemProperty -Path $path -Name 'AutoRestartDeadlinePeriodInDaysForFeatureUpdates' -Value 7 -Type DWord Intune XML
OMA-URI: ./Device/Vendor/MSFT/Policy/Config/Update/AutoRestartDeadlinePeriodInDays
Data type: String
Value:
<enabled/>
<data id="AutoRestartDeadline" value="7"/>
<data id="AutoRestartDeadlineForFeatureUpdates" value="7"/> Intune Remediation
# === Detection script ===
# Exported from gporais.com
# Policy: Specify deadline before auto-restart for update installation
# State: Enabled
# Supported on: Windows Server 2016 through Windows Server 2022, or Windows 10
function Test-RegistryValue {
param(
[Parameter(Mandatory = $true)][string]$Path,
[Parameter(Mandatory = $true)][string]$Name,
[object]$Expected,
[ValidateSet('String', 'DWord', 'MultiString')][string]$Kind = 'String',
[switch]$Absent
)
try {
$item = Get-ItemProperty -LiteralPath $Path -Name $Name -ErrorAction Stop
} catch {
return $Absent.IsPresent
}
if ($Absent.IsPresent) { return $false }
$actual = $item.$Name
if ($Kind -eq 'DWord') { return ([int64]$actual) -eq ([int64]$Expected) }
if ($Kind -eq 'MultiString') {
$actualValues = @($actual)
$expectedValues = @($Expected)
if ($actualValues.Count -ne $expectedValues.Count) { return $false }
for ($i = 0; $i -lt $expectedValues.Count; $i++) {
if ([string]$actualValues[$i] -ne [string]$expectedValues[$i]) { return $false }
}
return $true
}
return [string]$actual -eq [string]$Expected
}
$checks = @(
(Test-RegistryValue -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'SetAutoRestartDeadline' -Expected 1 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'AutoRestartDeadlinePeriodInDays' -Expected 7 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'AutoRestartDeadlinePeriodInDaysForFeatureUpdates' -Expected 7 -Kind DWord)
)
if ($checks -notcontains $false) {
Write-Output 'Compliant'
exit 0
}
Write-Output 'Non-compliant'
exit 1
# === Remediation script ===
# Exported from gporais.com
# Policy: Specify deadline before auto-restart for update installation
# State: Enabled
# Supported on: Windows Server 2016 through Windows Server 2022, or Windows 10
$path = 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate'
New-Item -Path $path -Force | Out-Null
Set-ItemProperty -Path $path -Name 'SetAutoRestartDeadline' -Value 1 -Type DWord
Set-ItemProperty -Path $path -Name 'AutoRestartDeadlinePeriodInDays' -Value 7 -Type DWord
Set-ItemProperty -Path $path -Name 'AutoRestartDeadlinePeriodInDaysForFeatureUpdates' -Value 7 -Type DWord SCCM scripts
# Exported from gporais.com
# Policy: Specify deadline before auto-restart for update installation
# State: Enabled
# Supported on: Windows Server 2016 through Windows Server 2022, or Windows 10
# SCCM Configuration Item guidance:
# Create a Configuration Item of type "Setting: Script".
# Discovery script: use the Detection script below.
# Remediation script: use the Remediation script below.
# Compliance rule: the Discovery script output equals 'Compliant'.
# === Detection script ===
# Exported from gporais.com
# Policy: Specify deadline before auto-restart for update installation
# State: Enabled
# Supported on: Windows Server 2016 through Windows Server 2022, or Windows 10
function Test-RegistryValue {
param(
[Parameter(Mandatory = $true)][string]$Path,
[Parameter(Mandatory = $true)][string]$Name,
[object]$Expected,
[ValidateSet('String', 'DWord', 'MultiString')][string]$Kind = 'String',
[switch]$Absent
)
try {
$item = Get-ItemProperty -LiteralPath $Path -Name $Name -ErrorAction Stop
} catch {
return $Absent.IsPresent
}
if ($Absent.IsPresent) { return $false }
$actual = $item.$Name
if ($Kind -eq 'DWord') { return ([int64]$actual) -eq ([int64]$Expected) }
if ($Kind -eq 'MultiString') {
$actualValues = @($actual)
$expectedValues = @($Expected)
if ($actualValues.Count -ne $expectedValues.Count) { return $false }
for ($i = 0; $i -lt $expectedValues.Count; $i++) {
if ([string]$actualValues[$i] -ne [string]$expectedValues[$i]) { return $false }
}
return $true
}
return [string]$actual -eq [string]$Expected
}
$checks = @(
(Test-RegistryValue -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'SetAutoRestartDeadline' -Expected 1 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'AutoRestartDeadlinePeriodInDays' -Expected 7 -Kind DWord)
(Test-RegistryValue -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'AutoRestartDeadlinePeriodInDaysForFeatureUpdates' -Expected 7 -Kind DWord)
)
if ($checks -notcontains $false) {
Write-Output 'Compliant'
exit 0
}
Write-Output 'Non-compliant'
exit 1
# === Remediation script ===
# Exported from gporais.com
# Policy: Specify deadline before auto-restart for update installation
# State: Enabled
# Supported on: Windows Server 2016 through Windows Server 2022, or Windows 10
$path = 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate'
New-Item -Path $path -Force | Out-Null
Set-ItemProperty -Path $path -Name 'SetAutoRestartDeadline' -Value 1 -Type DWord
Set-ItemProperty -Path $path -Name 'AutoRestartDeadlinePeriodInDays' -Value 7 -Type DWord
Set-ItemProperty -Path $path -Name 'AutoRestartDeadlinePeriodInDaysForFeatureUpdates' -Value 7 -Type DWord Building a multi-setting collection? Add this setting and generate combined .reg / PowerShell / GPO scripts.