設定自動更新的維護時段 的登錄值 MaintenanceWindowEnabled 等 16 個電腦HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate

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

登錄

MaintenanceWindowEnabled

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

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

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

:: 已啟用
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowEnabled" /t REG_DWORD /d 1 /f
:: 已停用
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowEnabled" /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 'MaintenanceWindowEnabled' -PropertyType DWord -Value 1 -Force | Out-Null
# 已停用
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowEnabled' -PropertyType DWord -Value 0 -Force | Out-Null

MaintenanceWindowUpdateActions

REG_DWORD電腦
啟用時的值
取決於選項值
元素
僅允許在維護時段內進行更新動作:
選項
項目儲存的值
下載、安裝並重新啟動1
安裝並重新啟動2
僅重新啟動3
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

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

; 選項 (只使用其中一個)
; 下載、安裝並重新啟動
"MaintenanceWindowUpdateActions"=dword:00000001
; 安裝並重新啟動
"MaintenanceWindowUpdateActions"=dword:00000002
; 僅重新啟動
"MaintenanceWindowUpdateActions"=dword:00000003
CMD
:: 選項 (只使用其中一個)

:: 下載、安裝並重新啟動
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowUpdateActions" /t REG_DWORD /d 1 /f
:: 安裝並重新啟動
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowUpdateActions" /t REG_DWORD /d 2 /f
:: 僅重新啟動
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowUpdateActions" /t REG_DWORD /d 3 /f
PowerShell
# 共通: 建立機碼
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Force | Out-Null

# 選項 (只使用其中一個)
# 下載、安裝並重新啟動
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowUpdateActions' -PropertyType DWord -Value 1 -Force | Out-Null
# 安裝並重新啟動
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowUpdateActions' -PropertyType DWord -Value 2 -Force | Out-Null
# 僅重新啟動
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowUpdateActions' -PropertyType DWord -Value 3 -Force | Out-Null

MaintenanceWindowStartDate

REG_SZ電腦
啟用時的值
取決於選項值
元素
開始日期 (格式: yyyy-mm-dd 範例: 2025-10-30)
值類型
REG_SZ
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

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

; 值名稱與類型依照 ADMX。請自行填入下方的 <輸入值>
"MaintenanceWindowStartDate"="<輸入值>"
CMD
:: 值名稱與類型依照 ADMX。請自行填入下方的 <輸入值>

reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowStartDate" /t REG_SZ /d "<輸入值>" /f
PowerShell
# 值名稱與類型依照 ADMX。請自行填入下方的 <輸入值>

New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Force | Out-Null
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowStartDate' -PropertyType String -Value '<輸入值>' -Force | Out-Null

MaintenanceWindowStartTime

REG_SZ電腦
啟用時的值
取決於選項值
元素
開始時間 (格式: hh:mm 範例: 23:30 表示下午 11:30)
值類型
REG_SZ
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

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

; 值名稱與類型依照 ADMX。請自行填入下方的 <輸入值>
"MaintenanceWindowStartTime"="<輸入值>"
CMD
:: 值名稱與類型依照 ADMX。請自行填入下方的 <輸入值>

reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowStartTime" /t REG_SZ /d "<輸入值>" /f
PowerShell
# 值名稱與類型依照 ADMX。請自行填入下方的 <輸入值>

New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Force | Out-Null
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowStartTime' -PropertyType String -Value '<輸入值>' -Force | Out-Null

MaintenanceWindowDurationHours

REG_DWORD電腦
啟用時的值
取決於選項值
元素
持續時間 (小時):
值類型
REG_DWORD
必要
true
最小值
2
最大值
24
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

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

; 值名稱與類型依照 ADMX。請自行填入下方的 <輸入值>
"MaintenanceWindowDurationHours"=dword:<輸入值>
CMD
:: 值名稱與類型依照 ADMX。請自行填入下方的 <輸入值>

reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowDurationHours" /t REG_DWORD /d "<輸入值>" /f
PowerShell
# 值名稱與類型依照 ADMX。請自行填入下方的 <輸入值>

New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Force | Out-Null
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowDurationHours' -PropertyType DWord -Value '<輸入值>' -Force | Out-Null

MaintenanceWindowRepeatScheduleOption

REG_DWORD電腦
啟用時的值
取決於選項值
元素
選取重複排程:
選項
項目儲存的值
不重複1
每天2
每週3
每月4
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

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

; 選項 (只使用其中一個)
; 不重複
"MaintenanceWindowRepeatScheduleOption"=dword:00000001
; 每天
"MaintenanceWindowRepeatScheduleOption"=dword:00000002
; 每週
"MaintenanceWindowRepeatScheduleOption"=dword:00000003
; 每月
"MaintenanceWindowRepeatScheduleOption"=dword:00000004
CMD
:: 選項 (只使用其中一個)

:: 不重複
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowRepeatScheduleOption" /t REG_DWORD /d 1 /f
:: 每天
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowRepeatScheduleOption" /t REG_DWORD /d 2 /f
:: 每週
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowRepeatScheduleOption" /t REG_DWORD /d 3 /f
:: 每月
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowRepeatScheduleOption" /t REG_DWORD /d 4 /f
PowerShell
# 共通: 建立機碼
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Force | Out-Null

# 選項 (只使用其中一個)
# 不重複
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowRepeatScheduleOption' -PropertyType DWord -Value 1 -Force | Out-Null
# 每天
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowRepeatScheduleOption' -PropertyType DWord -Value 2 -Force | Out-Null
# 每週
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowRepeatScheduleOption' -PropertyType DWord -Value 3 -Force | Out-Null
# 每月
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowRepeatScheduleOption' -PropertyType DWord -Value 4 -Force | Out-Null

MaintenanceWindowWeeklySunday

REG_DWORD電腦
已核取
1
未核取
0
元素
星期日
值類型
REG_DWORD
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

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

; 選項 (只使用其中一個)
; 已核取
"MaintenanceWindowWeeklySunday"=dword:00000001
; 未核取
"MaintenanceWindowWeeklySunday"=dword:00000000
CMD
:: 選項 (只使用其中一個)

:: 已核取
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowWeeklySunday" /t REG_DWORD /d 1 /f
:: 未核取
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowWeeklySunday" /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 'MaintenanceWindowWeeklySunday' -PropertyType DWord -Value 1 -Force | Out-Null
# 未核取
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowWeeklySunday' -PropertyType DWord -Value 0 -Force | Out-Null

MaintenanceWindowWeeklyMonday

REG_DWORD電腦
已核取
1
未核取
0
元素
星期一
值類型
REG_DWORD
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

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

; 選項 (只使用其中一個)
; 已核取
"MaintenanceWindowWeeklyMonday"=dword:00000001
; 未核取
"MaintenanceWindowWeeklyMonday"=dword:00000000
CMD
:: 選項 (只使用其中一個)

:: 已核取
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowWeeklyMonday" /t REG_DWORD /d 1 /f
:: 未核取
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowWeeklyMonday" /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 'MaintenanceWindowWeeklyMonday' -PropertyType DWord -Value 1 -Force | Out-Null
# 未核取
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowWeeklyMonday' -PropertyType DWord -Value 0 -Force | Out-Null

MaintenanceWindowWeeklyTuesday

REG_DWORD電腦
已核取
1
未核取
0
元素
星期二
值類型
REG_DWORD
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

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

; 選項 (只使用其中一個)
; 已核取
"MaintenanceWindowWeeklyTuesday"=dword:00000001
; 未核取
"MaintenanceWindowWeeklyTuesday"=dword:00000000
CMD
:: 選項 (只使用其中一個)

:: 已核取
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowWeeklyTuesday" /t REG_DWORD /d 1 /f
:: 未核取
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowWeeklyTuesday" /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 'MaintenanceWindowWeeklyTuesday' -PropertyType DWord -Value 1 -Force | Out-Null
# 未核取
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowWeeklyTuesday' -PropertyType DWord -Value 0 -Force | Out-Null

MaintenanceWindowWeeklyWednesday

REG_DWORD電腦
已核取
1
未核取
0
元素
星期三
值類型
REG_DWORD
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

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

; 選項 (只使用其中一個)
; 已核取
"MaintenanceWindowWeeklyWednesday"=dword:00000001
; 未核取
"MaintenanceWindowWeeklyWednesday"=dword:00000000
CMD
:: 選項 (只使用其中一個)

:: 已核取
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowWeeklyWednesday" /t REG_DWORD /d 1 /f
:: 未核取
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowWeeklyWednesday" /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 'MaintenanceWindowWeeklyWednesday' -PropertyType DWord -Value 1 -Force | Out-Null
# 未核取
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowWeeklyWednesday' -PropertyType DWord -Value 0 -Force | Out-Null

MaintenanceWindowWeeklyThursday

REG_DWORD電腦
已核取
1
未核取
0
元素
星期四
值類型
REG_DWORD
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

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

; 選項 (只使用其中一個)
; 已核取
"MaintenanceWindowWeeklyThursday"=dword:00000001
; 未核取
"MaintenanceWindowWeeklyThursday"=dword:00000000
CMD
:: 選項 (只使用其中一個)

:: 已核取
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowWeeklyThursday" /t REG_DWORD /d 1 /f
:: 未核取
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowWeeklyThursday" /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 'MaintenanceWindowWeeklyThursday' -PropertyType DWord -Value 1 -Force | Out-Null
# 未核取
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowWeeklyThursday' -PropertyType DWord -Value 0 -Force | Out-Null

MaintenanceWindowWeeklyFriday

REG_DWORD電腦
已核取
1
未核取
0
元素
星期五
值類型
REG_DWORD
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

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

; 選項 (只使用其中一個)
; 已核取
"MaintenanceWindowWeeklyFriday"=dword:00000001
; 未核取
"MaintenanceWindowWeeklyFriday"=dword:00000000
CMD
:: 選項 (只使用其中一個)

:: 已核取
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowWeeklyFriday" /t REG_DWORD /d 1 /f
:: 未核取
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowWeeklyFriday" /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 'MaintenanceWindowWeeklyFriday' -PropertyType DWord -Value 1 -Force | Out-Null
# 未核取
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowWeeklyFriday' -PropertyType DWord -Value 0 -Force | Out-Null

MaintenanceWindowWeeklySaturday

REG_DWORD電腦
已核取
1
未核取
0
元素
星期六
值類型
REG_DWORD
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

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

; 選項 (只使用其中一個)
; 已核取
"MaintenanceWindowWeeklySaturday"=dword:00000001
; 未核取
"MaintenanceWindowWeeklySaturday"=dword:00000000
CMD
:: 選項 (只使用其中一個)

:: 已核取
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowWeeklySaturday" /t REG_DWORD /d 1 /f
:: 未核取
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowWeeklySaturday" /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 'MaintenanceWindowWeeklySaturday' -PropertyType DWord -Value 1 -Force | Out-Null
# 未核取
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowWeeklySaturday' -PropertyType DWord -Value 0 -Force | Out-Null

MaintenanceWindowMonthlySchedule

REG_DWORD電腦
啟用時的值
取決於選項值
元素
每月排程類型:
選項
項目儲存的值
以日期為基礎1
以週為基礎2
當月的最後一天3
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

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

; 選項 (只使用其中一個)
; 以日期為基礎
"MaintenanceWindowMonthlySchedule"=dword:00000001
; 以週為基礎
"MaintenanceWindowMonthlySchedule"=dword:00000002
; 當月的最後一天
"MaintenanceWindowMonthlySchedule"=dword:00000003
CMD
:: 選項 (只使用其中一個)

:: 以日期為基礎
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowMonthlySchedule" /t REG_DWORD /d 1 /f
:: 以週為基礎
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowMonthlySchedule" /t REG_DWORD /d 2 /f
:: 當月的最後一天
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowMonthlySchedule" /t REG_DWORD /d 3 /f
PowerShell
# 共通: 建立機碼
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Force | Out-Null

# 選項 (只使用其中一個)
# 以日期為基礎
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowMonthlySchedule' -PropertyType DWord -Value 1 -Force | Out-Null
# 以週為基礎
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowMonthlySchedule' -PropertyType DWord -Value 2 -Force | Out-Null
# 當月的最後一天
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowMonthlySchedule' -PropertyType DWord -Value 3 -Force | Out-Null

MaintenanceWindowMonthlyMonthBasedDayOfMonth

REG_DWORD電腦
啟用時的值
取決於選項值
元素
月份日期:
值類型
REG_DWORD
必要
true
最小值
1
最大值
28
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

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

; 值名稱與類型依照 ADMX。請自行填入下方的 <輸入值>
"MaintenanceWindowMonthlyMonthBasedDayOfMonth"=dword:<輸入值>
CMD
:: 值名稱與類型依照 ADMX。請自行填入下方的 <輸入值>

reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowMonthlyMonthBasedDayOfMonth" /t REG_DWORD /d "<輸入值>" /f
PowerShell
# 值名稱與類型依照 ADMX。請自行填入下方的 <輸入值>

New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Force | Out-Null
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowMonthlyMonthBasedDayOfMonth' -PropertyType DWord -Value '<輸入值>' -Force | Out-Null

MaintenanceWindowMonthlyWeekBasedOccurrenceInMonth

REG_DWORD電腦
啟用時的值
取決於選項值
元素
每月發生次數
選項
項目儲存的值
First1
秒2
Third3
Fourth4
上次5
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

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

; 選項 (只使用其中一個)
; First
"MaintenanceWindowMonthlyWeekBasedOccurrenceInMonth"=dword:00000001
; 秒
"MaintenanceWindowMonthlyWeekBasedOccurrenceInMonth"=dword:00000002
; Third
"MaintenanceWindowMonthlyWeekBasedOccurrenceInMonth"=dword:00000003
; Fourth
"MaintenanceWindowMonthlyWeekBasedOccurrenceInMonth"=dword:00000004
; 上次
"MaintenanceWindowMonthlyWeekBasedOccurrenceInMonth"=dword:00000005
CMD
:: 選項 (只使用其中一個)

:: First
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowMonthlyWeekBasedOccurrenceInMonth" /t REG_DWORD /d 1 /f
:: 秒
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowMonthlyWeekBasedOccurrenceInMonth" /t REG_DWORD /d 2 /f
:: Third
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowMonthlyWeekBasedOccurrenceInMonth" /t REG_DWORD /d 3 /f
:: Fourth
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowMonthlyWeekBasedOccurrenceInMonth" /t REG_DWORD /d 4 /f
:: 上次
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowMonthlyWeekBasedOccurrenceInMonth" /t REG_DWORD /d 5 /f
PowerShell
# 共通: 建立機碼
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Force | Out-Null

# 選項 (只使用其中一個)
# First
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowMonthlyWeekBasedOccurrenceInMonth' -PropertyType DWord -Value 1 -Force | Out-Null
# 秒
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowMonthlyWeekBasedOccurrenceInMonth' -PropertyType DWord -Value 2 -Force | Out-Null
# Third
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowMonthlyWeekBasedOccurrenceInMonth' -PropertyType DWord -Value 3 -Force | Out-Null
# Fourth
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowMonthlyWeekBasedOccurrenceInMonth' -PropertyType DWord -Value 4 -Force | Out-Null
# 上次
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowMonthlyWeekBasedOccurrenceInMonth' -PropertyType DWord -Value 5 -Force | Out-Null

MaintenanceWindowMonthlyWeekBasedDayOfTheWeek

REG_DWORD電腦
啟用時的值
取決於選項值
元素
星期幾
選項
項目儲存的值
星期日1
星期一2
星期二3
星期三4
星期四5
星期五6
星期六7
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

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

; 選項 (只使用其中一個)
; 星期日
"MaintenanceWindowMonthlyWeekBasedDayOfTheWeek"=dword:00000001
; 星期一
"MaintenanceWindowMonthlyWeekBasedDayOfTheWeek"=dword:00000002
; 星期二
"MaintenanceWindowMonthlyWeekBasedDayOfTheWeek"=dword:00000003
; 星期三
"MaintenanceWindowMonthlyWeekBasedDayOfTheWeek"=dword:00000004
; 星期四
"MaintenanceWindowMonthlyWeekBasedDayOfTheWeek"=dword:00000005
; 星期五
"MaintenanceWindowMonthlyWeekBasedDayOfTheWeek"=dword:00000006
; 星期六
"MaintenanceWindowMonthlyWeekBasedDayOfTheWeek"=dword:00000007
CMD
:: 選項 (只使用其中一個)

:: 星期日
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowMonthlyWeekBasedDayOfTheWeek" /t REG_DWORD /d 1 /f
:: 星期一
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowMonthlyWeekBasedDayOfTheWeek" /t REG_DWORD /d 2 /f
:: 星期二
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowMonthlyWeekBasedDayOfTheWeek" /t REG_DWORD /d 3 /f
:: 星期三
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowMonthlyWeekBasedDayOfTheWeek" /t REG_DWORD /d 4 /f
:: 星期四
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowMonthlyWeekBasedDayOfTheWeek" /t REG_DWORD /d 5 /f
:: 星期五
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowMonthlyWeekBasedDayOfTheWeek" /t REG_DWORD /d 6 /f
:: 星期六
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate" /v "MaintenanceWindowMonthlyWeekBasedDayOfTheWeek" /t REG_DWORD /d 7 /f
PowerShell
# 共通: 建立機碼
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Force | Out-Null

# 選項 (只使用其中一個)
# 星期日
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowMonthlyWeekBasedDayOfTheWeek' -PropertyType DWord -Value 1 -Force | Out-Null
# 星期一
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowMonthlyWeekBasedDayOfTheWeek' -PropertyType DWord -Value 2 -Force | Out-Null
# 星期二
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowMonthlyWeekBasedDayOfTheWeek' -PropertyType DWord -Value 3 -Force | Out-Null
# 星期三
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowMonthlyWeekBasedDayOfTheWeek' -PropertyType DWord -Value 4 -Force | Out-Null
# 星期四
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowMonthlyWeekBasedDayOfTheWeek' -PropertyType DWord -Value 5 -Force | Out-Null
# 星期五
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowMonthlyWeekBasedDayOfTheWeek' -PropertyType DWord -Value 6 -Force | Out-Null
# 星期六
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate' -Name 'MaintenanceWindowMonthlyWeekBasedDayOfTheWeek' -PropertyType DWord -Value 7 -Force | Out-Null