指定自動重新啟動的使用時間範圍 的登錄值 SetActiveHoursMaxRange 等 1 個電腦HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate

原則 ID
ActiveHoursMaxRange
適用範圍
電腦設定
支援的作業系統
至少需要 Windows Server 2016 或 Windows 10
來源
Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (版本 1.0)
類別
Windows 元件 › Windows Update › 管理使用者體驗

登錄

SetActiveHoursMaxRange

REG_DWORD電腦
啟用時的值
1
停用時的值
0
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

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

; 選項 (只使用其中一個)
; 已啟用
"SetActiveHoursMaxRange"=dword:00000001
; 已停用
"SetActiveHoursMaxRange"=dword:00000000
CMD
:: 選項 (只使用其中一個)

:: 已啟用
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "SetActiveHoursMaxRange" /t REG_DWORD /d 1 /f
:: 已停用
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "SetActiveHoursMaxRange" /t REG_DWORD /d 0 /f
PowerShell
# 共通: 建立機碼
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Force | Out-Null

# 選項 (只使用其中一個)
# 已啟用
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'SetActiveHoursMaxRange' -PropertyType DWord -Value 1 -Force | Out-Null
# 已停用
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'SetActiveHoursMaxRange' -PropertyType DWord -Value 0 -Force | Out-Null

ActiveHoursMaxRange

REG_DWORD電腦
啟用時的值
取決於選項值
元素
最大範圍:
選項
項目儲存的值
88
99
1010
1111
1212
1313
1414
1515
1616
1717
1818
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

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

; 選項 (只使用其中一個)
; 8
"ActiveHoursMaxRange"=dword:00000008
; 9
"ActiveHoursMaxRange"=dword:00000009
; 10
"ActiveHoursMaxRange"=dword:0000000a
; 11
"ActiveHoursMaxRange"=dword:0000000b
; 12
"ActiveHoursMaxRange"=dword:0000000c
; 13
"ActiveHoursMaxRange"=dword:0000000d
; 14
"ActiveHoursMaxRange"=dword:0000000e
; 15
"ActiveHoursMaxRange"=dword:0000000f
; 16
"ActiveHoursMaxRange"=dword:00000010
; 17
"ActiveHoursMaxRange"=dword:00000011
; 18
"ActiveHoursMaxRange"=dword:00000012
CMD
:: 選項 (只使用其中一個)

:: 8
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursMaxRange" /t REG_DWORD /d 8 /f
:: 9
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursMaxRange" /t REG_DWORD /d 9 /f
:: 10
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursMaxRange" /t REG_DWORD /d 10 /f
:: 11
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursMaxRange" /t REG_DWORD /d 11 /f
:: 12
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursMaxRange" /t REG_DWORD /d 12 /f
:: 13
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursMaxRange" /t REG_DWORD /d 13 /f
:: 14
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursMaxRange" /t REG_DWORD /d 14 /f
:: 15
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursMaxRange" /t REG_DWORD /d 15 /f
:: 16
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursMaxRange" /t REG_DWORD /d 16 /f
:: 17
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursMaxRange" /t REG_DWORD /d 17 /f
:: 18
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "ActiveHoursMaxRange" /t REG_DWORD /d 18 /f
PowerShell
# 共通: 建立機碼
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Force | Out-Null

# 選項 (只使用其中一個)
# 8
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursMaxRange' -PropertyType DWord -Value 8 -Force | Out-Null
# 9
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursMaxRange' -PropertyType DWord -Value 9 -Force | Out-Null
# 10
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursMaxRange' -PropertyType DWord -Value 10 -Force | Out-Null
# 11
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursMaxRange' -PropertyType DWord -Value 11 -Force | Out-Null
# 12
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursMaxRange' -PropertyType DWord -Value 12 -Force | Out-Null
# 13
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursMaxRange' -PropertyType DWord -Value 13 -Force | Out-Null
# 14
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursMaxRange' -PropertyType DWord -Value 14 -Force | Out-Null
# 15
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursMaxRange' -PropertyType DWord -Value 15 -Force | Out-Null
# 16
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursMaxRange' -PropertyType DWord -Value 16 -Force | Out-Null
# 17
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursMaxRange' -PropertyType DWord -Value 17 -Force | Out-Null
# 18
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'ActiveHoursMaxRange' -PropertyType DWord -Value 18 -Force | Out-Null