Turn off auto-restart for updates during active hours: registry value SetActiveHours and 2 moreComputerHKLM\Software\Policies\Microsoft\Windows\WindowsUpdate

Policy ID
ActiveHours
Scope
Computer Configuration
Supported on
At least Windows Server 2016 or Windows 10
Source
Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (version 1.0)
Category
Windows Components › Windows Update › Manage end user experience

Registry

SetActiveHours

REG_DWORDComputer
Enabled value
1
Disabled value
0
Apply with .reg · CMD · PowerShell
.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate]

; Options (use only one)
; Enabled
"SetActiveHours"=dword:00000001
; Disabled
"SetActiveHours"=dword:00000000
CMD
:: Options (use only one)

:: Enabled
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "SetActiveHours" /t REG_DWORD /d 1 /f
:: Disabled
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "SetActiveHours" /t REG_DWORD /d 0 /f
PowerShell
# Common: create the key
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Force | Out-Null

# Options (use only one)
# Enabled
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'SetActiveHours' -PropertyType DWord -Value 1 -Force | Out-Null
# Disabled
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'SetActiveHours' -PropertyType DWord -Value 0 -Force | Out-Null

ActiveHoursStart

REG_DWORDComputer
Enabled value
Depends on the option value
Element
Start:
Options
ItemStored value
12 AM0
1 AM1
2 AM2
3 AM3
4 AM4
5 AM5
6 AM6
7 AM7
8 AM8
9 AM9
10 AM10
11 AM11
12 PM12
1 PM13
2 PM14
3 PM15
4 PM16
5 PM17
6 PM18
7 PM19
8 PM20
9 PM21
10 PM22
11 PM23
Apply with .reg · CMD · PowerShell
.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate]

; Options (use only one)
; 12 AM
"ActiveHoursStart"=dword:00000000
; 1 AM
"ActiveHoursStart"=dword:00000001
; 2 AM
"ActiveHoursStart"=dword:00000002
; 3 AM
"ActiveHoursStart"=dword:00000003
; 4 AM
"ActiveHoursStart"=dword:00000004
; 5 AM
"ActiveHoursStart"=dword:00000005
; 6 AM
"ActiveHoursStart"=dword:00000006
; 7 AM
"ActiveHoursStart"=dword:00000007
; 8 AM
"ActiveHoursStart"=dword:00000008
; 9 AM
"ActiveHoursStart"=dword:00000009
; 10 AM
"ActiveHoursStart"=dword:0000000a
; 11 AM
"ActiveHoursStart"=dword:0000000b
; 12 PM
"ActiveHoursStart"=dword:0000000c
; 1 PM
"ActiveHoursStart"=dword:0000000d
; 2 PM
"ActiveHoursStart"=dword:0000000e
; 3 PM
"ActiveHoursStart"=dword:0000000f
; 4 PM
"ActiveHoursStart"=dword:00000010
; 5 PM
"ActiveHoursStart"=dword:00000011
; 6 PM
"ActiveHoursStart"=dword:00000012
; 7 PM
"ActiveHoursStart"=dword:00000013
; 8 PM
"ActiveHoursStart"=dword:00000014
; 9 PM
"ActiveHoursStart"=dword:00000015
; 10 PM
"ActiveHoursStart"=dword:00000016
; 11 PM
"ActiveHoursStart"=dword:00000017
CMD
:: Options (use only one)

:: 12 AM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 0 /f
:: 1 AM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 1 /f
:: 2 AM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 2 /f
:: 3 AM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 3 /f
:: 4 AM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 4 /f
:: 5 AM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 5 /f
:: 6 AM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 6 /f
:: 7 AM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 7 /f
:: 8 AM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 8 /f
:: 9 AM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 9 /f
:: 10 AM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 10 /f
:: 11 AM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 11 /f
:: 12 PM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 12 /f
:: 1 PM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 13 /f
:: 2 PM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 14 /f
:: 3 PM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 15 /f
:: 4 PM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 16 /f
:: 5 PM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 17 /f
:: 6 PM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 18 /f
:: 7 PM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 19 /f
:: 8 PM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 20 /f
:: 9 PM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 21 /f
:: 10 PM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 22 /f
:: 11 PM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursStart" /t REG_DWORD /d 23 /f
PowerShell
# Common: create the key
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Force | Out-Null

# Options (use only one)
# 12 AM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 0 -Force | Out-Null
# 1 AM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 1 -Force | Out-Null
# 2 AM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 2 -Force | Out-Null
# 3 AM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 3 -Force | Out-Null
# 4 AM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 4 -Force | Out-Null
# 5 AM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 5 -Force | Out-Null
# 6 AM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 6 -Force | Out-Null
# 7 AM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 7 -Force | Out-Null
# 8 AM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 8 -Force | Out-Null
# 9 AM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 9 -Force | Out-Null
# 10 AM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 10 -Force | Out-Null
# 11 AM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 11 -Force | Out-Null
# 12 PM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 12 -Force | Out-Null
# 1 PM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 13 -Force | Out-Null
# 2 PM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 14 -Force | Out-Null
# 3 PM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 15 -Force | Out-Null
# 4 PM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 16 -Force | Out-Null
# 5 PM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 17 -Force | Out-Null
# 6 PM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 18 -Force | Out-Null
# 7 PM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 19 -Force | Out-Null
# 8 PM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 20 -Force | Out-Null
# 9 PM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 21 -Force | Out-Null
# 10 PM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 22 -Force | Out-Null
# 11 PM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursStart' -PropertyType DWord -Value 23 -Force | Out-Null

ActiveHoursEnd

REG_DWORDComputer
Enabled value
Depends on the option value
Element
End:
Options
ItemStored value
12 AM0
1 AM1
2 AM2
3 AM3
4 AM4
5 AM5
6 AM6
7 AM7
8 AM8
9 AM9
10 AM10
11 AM11
12 PM12
1 PM13
2 PM14
3 PM15
4 PM16
5 PM17
6 PM18
7 PM19
8 PM20
9 PM21
10 PM22
11 PM23
Apply with .reg · CMD · PowerShell
.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate]

; Options (use only one)
; 12 AM
"ActiveHoursEnd"=dword:00000000
; 1 AM
"ActiveHoursEnd"=dword:00000001
; 2 AM
"ActiveHoursEnd"=dword:00000002
; 3 AM
"ActiveHoursEnd"=dword:00000003
; 4 AM
"ActiveHoursEnd"=dword:00000004
; 5 AM
"ActiveHoursEnd"=dword:00000005
; 6 AM
"ActiveHoursEnd"=dword:00000006
; 7 AM
"ActiveHoursEnd"=dword:00000007
; 8 AM
"ActiveHoursEnd"=dword:00000008
; 9 AM
"ActiveHoursEnd"=dword:00000009
; 10 AM
"ActiveHoursEnd"=dword:0000000a
; 11 AM
"ActiveHoursEnd"=dword:0000000b
; 12 PM
"ActiveHoursEnd"=dword:0000000c
; 1 PM
"ActiveHoursEnd"=dword:0000000d
; 2 PM
"ActiveHoursEnd"=dword:0000000e
; 3 PM
"ActiveHoursEnd"=dword:0000000f
; 4 PM
"ActiveHoursEnd"=dword:00000010
; 5 PM
"ActiveHoursEnd"=dword:00000011
; 6 PM
"ActiveHoursEnd"=dword:00000012
; 7 PM
"ActiveHoursEnd"=dword:00000013
; 8 PM
"ActiveHoursEnd"=dword:00000014
; 9 PM
"ActiveHoursEnd"=dword:00000015
; 10 PM
"ActiveHoursEnd"=dword:00000016
; 11 PM
"ActiveHoursEnd"=dword:00000017
CMD
:: Options (use only one)

:: 12 AM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 0 /f
:: 1 AM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 1 /f
:: 2 AM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 2 /f
:: 3 AM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 3 /f
:: 4 AM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 4 /f
:: 5 AM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 5 /f
:: 6 AM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 6 /f
:: 7 AM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 7 /f
:: 8 AM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 8 /f
:: 9 AM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 9 /f
:: 10 AM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 10 /f
:: 11 AM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 11 /f
:: 12 PM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 12 /f
:: 1 PM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 13 /f
:: 2 PM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 14 /f
:: 3 PM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 15 /f
:: 4 PM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 16 /f
:: 5 PM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 17 /f
:: 6 PM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 18 /f
:: 7 PM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 19 /f
:: 8 PM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 20 /f
:: 9 PM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 21 /f
:: 10 PM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 22 /f
:: 11 PM
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursEnd" /t REG_DWORD /d 23 /f
PowerShell
# Common: create the key
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Force | Out-Null

# Options (use only one)
# 12 AM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 0 -Force | Out-Null
# 1 AM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 1 -Force | Out-Null
# 2 AM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 2 -Force | Out-Null
# 3 AM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 3 -Force | Out-Null
# 4 AM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 4 -Force | Out-Null
# 5 AM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 5 -Force | Out-Null
# 6 AM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 6 -Force | Out-Null
# 7 AM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 7 -Force | Out-Null
# 8 AM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 8 -Force | Out-Null
# 9 AM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 9 -Force | Out-Null
# 10 AM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 10 -Force | Out-Null
# 11 AM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 11 -Force | Out-Null
# 12 PM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 12 -Force | Out-Null
# 1 PM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 13 -Force | Out-Null
# 2 PM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 14 -Force | Out-Null
# 3 PM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 15 -Force | Out-Null
# 4 PM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 16 -Force | Out-Null
# 5 PM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 17 -Force | Out-Null
# 6 PM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 18 -Force | Out-Null
# 7 PM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 19 -Force | Out-Null
# 8 PM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 20 -Force | Out-Null
# 9 PM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 21 -Force | Out-Null
# 10 PM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 22 -Force | Out-Null
# 11 PM
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursEnd' -PropertyType DWord -Value 23 -Force | Out-Null