更新之後重新啟動管理裝置Manage device restarts after updates

適用於Applies to

  • Windows 10Windows 10

正在尋找消費者資訊嗎?Looking for consumer information? 請參閱 Windows Update:常見問題集See Windows Update: FAQ

您可以使用群組原則設定、行動裝置管理 (MDM) 或註冊表 (,) 來設定安裝 Windows 10 更新後裝置何時會重新開機。You can use Group Policy settings, mobile device management (MDM), or Registry (not recommended) to configure when devices will restart after a Windows 10 update is installed. 您可以排程更新安裝並設定重新啟動原則、設定不發生重新啟動的使用時間,或者您可以兩者都設定。You can schedule update installation and set policies for restart, configure active hours for when restarts will not occur, or you can do both.

排程更新安裝Schedule update installation

在群組原則中,位於 [設定自動更新] 內,您可以設定在指定的安裝時間後強制重新開機。In Group Policy, within Configure Automatic Updates, you can configure a forced restart after a specified installation time.

設定時間需要移至 [設定自動更新],選取 [4 - 自動下載和排程安裝] 選項,然後在 [排程安裝時間] 下拉式清單中輸入時間。To set the time, you need to go to Configure Automatic Updates, select option 4 - Auto download and schedule the install, and then enter a time in the Scheduled install time dropdown. 或者,您可以指定該安裝在自動維護期間進行 (使用 [電腦設定\系統管理範本\Windows 元件\維護排程] 設定)。Alternatively, you can specify that installation will occur during the automatic maintenance time (configured using Computer Configuration\Administrative Templates\Windows Components\Maintenance Scheduler).

[一律在排定的時間自動重新啟動] 會在指定的安裝時間之後強制重新啟動,且讓您設定警告已登入使用者即將重新啟動的計時器。Always automatically restart at the scheduled time forces a restart after the specified installation time and lets you configure a timer to warn a signed-in user that a restart is going to occur.

雖然不建議這樣做,但是可以透過登錄達成相同的結果。While not recommended, the same result can be achieved through Registry. HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU,將 AuOptions 設定為 4,使用 ScheduledInstallTime 設定安裝時間,啟用 AlwaysAutoRebootAtScheduledTime,並透過 AlwaysAutoRebootAtScheduledTimeMinutes 以分鐘數分鐘指定延遲。Under HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU, set AuOptions to 4, set the install time with ScheduledInstallTime, enable AlwaysAutoRebootAtScheduledTime and specify the delay in minutes through AlwaysAutoRebootAtScheduledTimeMinutes. 與群組原則類似,AlwaysAutoRebootAtScheduledTimeMinutes 會設定計時器來警告登入的使用者即將重新開機。Similar to Group Policy, AlwaysAutoRebootAtScheduledTimeMinutes sets the timer to warn a signed-in user that a restart is going to occur.

如需這些登錄機碼的詳細描述,請參閱用來管理重新開機的登錄機碼For a detailed description of these registry keys, see Registry keys used to manage restart.

延遲自動重新開機Delay automatic reboot

當群組原則中啟用 [設定自動更新] 時,您可以啟用下列其他原則之一,在安裝更新之後延遲自動重新開機:When Configure Automatic Updates is enabled in Group Policy, you can enable one of the following additional policies to delay an automatic reboot after update installation:

  • [在使用時間期間關閉安裝更新後的自動重新啟動] 會防止在使用期間重新開機。Turn off auto-restart for updates during active hours prevents automatic restart during active hours.
  • [有使用者登入時不自動重新開機以完成排定的自動更新安裝] 會防止在有使用者登入時自動重新啟動。No auto-restart with logged on users for scheduled automatic updates installations prevents automatic restart when a user is signed in. 如果使用者在更新通知中排定重新啟動,即便使用者在該時間已登入,裝置仍會按時重新啟動。If a user schedules the restart in the update notification, the device will restart at the time the user specifies even if a user is signed in at the time. 這項原則僅適用於將 [設定自動更新] 設為 [4-有使用者登入時不自動重新開機以完成排定的自動更新安裝] 選項的時候。This policy only applies when Configure Automatic Updates is set to option 4-Auto download and schedule the install.

注意

使用遠端桌面通訊協定連接時,只有使用中的 RDP 會話會視為已登入的使用者。When using Remote Desktop Protocol connections, only active RDP sessions are considered as logged on users. 系統將會重新開機未在本地登入使用者或使用中 RDP 會話的裝置。Devices that do not have locally logged on users, or active RDP sessions, will be restarted.

您也可以使用登錄,避免在使用者登入時自動重新開機。You can also use Registry, to prevent automatic restarts when a user is signed in. HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU 下,將 AuOptions 設定為 4 並啟用 NoAutoRebootWithLoggedOnUsersUnder HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU, set AuOptions to 4 and enable NoAutoRebootWithLoggedOnUsers. 如同使用群組原則,如果使用者在更新通知中排程重新開機,它將會覆寫此設定。As with Group Policy, if a user schedules the restart in the update notification, it will override this setting.

如需這些登錄機碼的詳細描述,請參閱用來管理重新開機的登錄機碼For a detailed description of these registry keys, see Registry keys used to manage restart.

設定使用時間Configure active hours

[使用時間] 會識別您預期裝置處於使用中的一段時間。Active hours identify the period of time when you expect the device to be in use. 更新之後的自動重新啟動會在使用時間之外發生。Automatic restarts after an update will occur outside of the active hours.

根據預設,電腦的使用時間是從上午 8 點到下午 5 點,手機是從上午 5 點到下午 11 點。By default, active hours are from 8 AM to 5 PM on PCs and from 5 AM to 11 PM on phones. 使用者可以手動變更使用時間。Users can change the active hours manually.

從 Windows 10 版本 1703 開始,您也可以指定最大的使用時間範圍。Starting with Windows 10, version 1703, you can also specify the max active hours range. 指定的範圍將會從使用時間的開始時間來計算。The specified range will be counted from the active hours start time.

系統管理員可以使用多種方法設定受管理裝置的使用時間︰Administrators can use multiple ways to set active hours for managed devices:

使用群組原則設定使用時間Configuring active hours with Group Policy

若要使用群組原則設定使用時間,請移至 [電腦設定\系統管理範本\Windows 元件\Windows Update] 並開啟 [在使用時間期間關閉安裝更新後的自動重新啟動] 原則設定。To configure active hours using Group Policy, go to Computer Configuration\Administrative Templates\Windows Components\Windows Update and open the Turn off auto-restart for updates during active hours policy setting. 將原則啟用之後,您可以設定使用時間的開始和結束時間。When the policy is enabled, you can set the start and end times for active hours.

使用群組原則設定使用時間

使用 MDM 設定使用時間Configuring active hours with MDM

MDM 使用 Policy CSP 中的 Update/ActiveHoursStart and Update/ActiveHoursEndUpdate/ActiveHoursMaxRange 設定來設定使用時間。MDM uses the Update/ActiveHoursStart and Update/ActiveHoursEnd and Update/ActiveHoursMaxRange settings in the Policy CSP to configure active hours.

透過登錄設定使用時間Configuring active hours through Registry

不建議使用此方法,而且只有在您無法使用群組原則或 MDM 時才能使用。This method is not recommended, and should only be used when you can't use Group Policy or MDM. 透過登錄設定的任何設定都可能與使用上述任何方法的現有設定相衝突。Any settings configured through Registry may conflict with any existing configuration that uses any of the methods mentioned above.

設定下列註冊表值的組合來設定使用中小時:Configure active hours by setting a combination of the following registry values:

HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate 下,使用 SetActiveHours 啟用或停用使用中時數, 而 ActiveHoursStartActiveHoursEnd 可指定使用中時數的範圍。Under HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate use SetActiveHours to enable or disable active hours and ActiveHoursStart and ActiveHoursEnd to specify the range of active hours.

如需這些登錄機碼的詳細描述,請參閱用來管理重新開機的登錄機碼For a detailed description of these registry keys, see Registry keys used to manage restart.

注意

若要在單一裝置上手動設定使用時間,請移至 [設定] > [更新與安全性] > [Windows Update],並選取 [變更使用時間]。To configure active hours manually on a single device, go to Settings > Update & security > Windows Update and select Change active hours.

變更使用時間

設定最大的使用時間範圍Configuring active hours max range

在 Windows 10 版本 1703 中,系統管理員可以指定使用者能設定的最大使用時間範圍。With Windows 10, version 1703, administrators can specify the max active hours range users can set. 此選項可讓您有更多彈性,將某些使用時間留給使用者決定,同時確保有足夠的時間能進行更新。This option gives you additional flexibility to leave some of the decision for active hours on the user's side, while making sure you allow enough time for updating. 最大範圍是從使用時間的開始時間計算。The max range is calculated from active hours start time.

若要透過群組原則設定最大的使用時間範圍,請移至 [電腦設定\系統管理範本\Windows 元件\Windows Update],然後開啟 [指定自動重新啟動的使用時間範圍]。To configure active hours max range through Group Policy, go to Computer Configuration\Administrative Templates\Windows Components\Windows Update and open the Specify active hours range for auto-restarts.

若要透過 MDM 設定最大使用時間範圍,請使用 Update/ActiveHoursMaxRangeTo configure active hours max range through MDM, use Update/ActiveHoursMaxRange.

限制重新開機延遲Limit restart delays

安裝更新之後,Windows10 會在使用時間以外嘗試自動重新開機。After an update is installed, Windows 10 attempts automatic restart outside of active hours. 如果根據預設, (7 天后重新開機) ,使用者會看到需要重新開機的通知。If the restart does not succeed after seven days (by default), the user will see a notification that restart is required. 您可以使用自動重新開機前 指定 期限以更新安裝策略,將延遲從七天變更為兩到十四之間的任何天數。You can use the Specify deadline before auto-restart for update installation policy to change the delay from seven days to any number of days between two and 14.

控制重新啟動通知Control restart notifications

在 Windows 10 版本 1703 中,我們新增了設定來控制使用者的重新啟動通知。In Windows 10, version 1703, we have added settings to control restart notifications for users.

自動重新啟動通知Auto-restart notifications

系統管理員可以覆寫自動重新啟動所需通知的預設行為。Administrators can override the default behavior for the auto-restart required notification. 根據預設,此通知將會自動關閉。By default, this notification will dismiss automatically.

若要透過群組原則設定此行為,請移至 [電腦設定\系統管理範本\Windows 元件\Windows Update] 並選取 [設定更新的需要自動重新啟動通知]。To configure this behavior through Group Policy, go to Computer Configuration\Administrative Templates\Windows Components\Windows Update and select Configure auto-restart required notification for updates. 設定為 [2 - 使用者動作] 時,收到此通知的使用者必須手動將它關閉。When configured to 2 - User Action, a user that gets this notification must manually dismiss it.

若要透過 MDM 設定此行為,請使用 Update/AutoRestartRequiredNotificationDismissalTo configure this behavior through MDM, use Update/AutoRestartRequiredNotificationDismissal

您也可以設定在更新之前,此通知將顯示的期間。You can also configure the period prior to an update that this notification will show up on. 預設值是 15 分鐘。The default value is 15 minutes.

若要透過群組原則變更它,請選取 [設定更新的自動重新啟動提醒通知],位於 [電腦設定\系統管理範本\Windows 元件\Windows Update],底下,然後選取期間 (單位分鐘)。To change it through Group Policy, select Configure auto-restart-reminder notifications for updates under Computer Configuration\Administrative Templates\Windows Components\Windows Update and select the period in minutes.

若要透過 MDM 變更它,請使用 Update/AutoRestartNotificationScheduleTo change it through MDM, use Update/AutoRestartNotificationSchedule.

某些情況下,您不需要顯示通知。In some cases, you don't need a notification to show up.

若要透過群組原則這樣做,請移至 [電腦設定\系統管理範本\Windows 元件\Windows Update],並選取 [關閉更新安裝後的自動重新啟動通知]。To do so through Group Policy, go to Computer Configuration\Administrative Templates\Windows Components\Windows Update and select Turn off auto-restart notifications for update installations.

若要透過 MDM 這樣做,請使用 Update/SetAutoRestartNotificationDisableTo do so through MDM, use Update/SetAutoRestartNotificationDisable.

排程的自動重新啟動警告Scheduled auto-restart warnings

由於在達到期限時,使用者無法延後排程的重新開機,因此您可以在排程的重新開機之前設定警告提醒。Since users are not able to postpone a scheduled restart once the deadline has been reached, you can configure a warning reminder prior to the scheduled restart. 您也可以設定在重新開機之前顯示的警告,通知使用者即將進行重新開機,讓他們儲存自己的工作。You can also configure a warning prior to the restart, to notify users once the restart is imminent and allow them to save their work.

若要透過群組原則設定兩者,請在 [電腦設定\系統管理範本\Windows 元件\Windows Update] 底下尋找 [設定更新的自動重新啟動警告通知排程]。To configure both through Group Policy, find Configure auto-restart warning notifications schedule for updates under Computer Configuration\Administrative Templates\Windows Components\Windows Update. 警告提醒可藉由 [提醒 (小時) ] 設定,即將自動重新啟動之前的警告則可透過 [警告 (分鐘) ] 設定。The warning reminder can be configured by Reminder (hours) and the warning prior to an imminent auto-restart can be configured by Warning (mins).

在 MDM 中,警告提醒是使用 Update/ScheduleRestartWarning 設定,即將自動重新啟動警告是使用 Update/ScheduleImminentRestartWarning 設定。In MDM, the warning reminder is configured using Update/ScheduleRestartWarning and the auto-restart imminent warning is configured using Update/ScheduleImminentRestartWarning.

已啟用重新啟動Engaged restart

已啟用重新啟動是使用者需要排程重新開機的時間。Engaged restart is the period of time when users are required to schedule a restart. 一開始,Windows 會在工作時間以外的時段自動重新開機。Initially, Windows will auto-restart outside of working hours. 設定期間在 (七天后結束之後) Windows 會轉場到使用者排定的重新開機。Once the set period ends (seven days by default), Windows transitions to user scheduled restarts.

以下是可針對已啟用重新啟動調整的設定:The following settings can be adjusted for engaged restart:

  • 自動重新開機轉換成已啟用重新啟動之前的期間。Period of time before auto-restart transitions to engaged restart.
  • 使用者可以延遲已啟用重新啟動提醒通知的天數。The number of days that users can snooze engaged restart reminder notifications.
  • 擱置中重新啟動在工作時間以外自動執行之前的天數。The number of days before a pending restart automatically executes outside of working hours.

在群組原則中,移至 [電腦設定\系統管理範本\Windows 元件\Windows Update],然後挑選 [為更新指定啟用的重新啟動轉換和通知排程]。In Group Policy, go to Computer Configuration\Administrative Templates\Windows Components\Windows Update and pick Specify Engaged restart transition and notification schedule for updates.

在 MDM 中分別使用 Update/EngagedRestartTransitionScheduleUpdate/EngagedRestartSnoozeScheduleUpdate/EngagedRestartDeadlineIn MDM, use Update/EngagedRestartTransitionSchedule, Update/EngagedRestartSnoozeSchedule and Update/EngagedRestartDeadline respectively.

重新啟動的群組原則設定Group Policy settings for restart

在群組原則編輯器中,您會看到 [電腦設定\系統管理範本\Windows 元件\Windows Update] 中有一些適用於重新啟動行為的原則設定。In the Group Policy editor, you will see a number of policy settings that pertain to restart behavior in Computer Configuration\Administrative Templates\Windows Components\Windows Update. 下表顯示哪些原則適用於 Windows10。The following table shows which policies apply to Windows 10.

原則Policy 適用於 Windows10Applies to Windows 10 附註Notes
在使用時間期間關閉安裝更新後的自動重新啟動Turn off auto-restart for updates during active hours 是 使用此原則來設定使用時間,裝置不會在這段期間重新啟動。Use this policy to configure active hours, during which the device will not be restarted. 如果已啟用 [有使用者登入時不自動重新開機以完成排定的自動更新安裝][一律在排定的時間自動重新啟動] 原則,則此原則不會有效。This policy has no effect if the No auto-restart with logged on users for scheduled automatic updates installations or Always automatically restart at the scheduled time policies are enabled.
一律在排定的時間自動重新啟動Always automatically restart at the scheduled time 是 使用此原則來設定會在 Windows Update 安裝重要更新之後立即啟動的重新啟動計時器 (介於 15 和 180 分鐘之間)。Use this policy to configure a restart timer (between 15 and 180 minutes) that will start immediately after Windows Update installs important updates. 此原則不會影響已啟用的 [有使用者登入時不自動重新開機以完成排定的自動更新安裝] 原則。This policy has no effect if the No auto-restart with logged on users for scheduled automatic updates installations policy is enabled.
指定安裝更新後的自動重新啟動期限Specify deadline before auto-restart for update installation 是 使用此原則來指定可以將自動重新啟動延遲多少天 (介於 2 和 14 之間)。Use this policy to specify how many days (between 2 and 14) an automatic restart can be delayed. 如果已啟用 [有使用者登入時不自動重新開機以完成排定的自動更新安裝][一律在排定的時間自動重新啟動] 原則,則此原則不會有效。This policy has no effect if the No auto-restart with logged on users for scheduled automatic updates installations or Always automatically restart at the scheduled time policies are enabled.
有使用者登入時不自動重新開機以完成排定的自動更新安裝No auto-restart with logged on users for scheduled automatic updates installations 是 使用此原則來防止在使用者已登入的時候自動重新啟動。Use this policy to prevent automatic restart when a user is logged on. 已設定 [設定自動更新] 原則來執行排定的更新安裝時,此原則才適用。This policy applies only when the Configure Automatic Updates policy is configured to perform scheduled installations of updates.
沒有適用於 Windows10 行動裝置版的對等 MDM 原則設定。There is no equivalent MDM policy setting for Windows 10 Mobile.
再次提示排程安裝所需的重新啟動Re-prompt for restart with scheduled installations 否
延遲排程安裝的重新啟動Delay Restart for scheduled installations 否
重新排程已經排程好的自動更新安裝Reschedule Automatic Updates scheduled installations 否

注意

您只能為重新開機的行為選擇一個路徑。You can only choose one path for restart behavior. 如果您設定有衝突的重新開機原則,則實際的重新開機時間可能不會如您所預期。If you set conflicting restart policies, the actual restart behavior may not be what you expected. 使用 RDP 時,只有使用中的 RDP 會話會視為已登入的使用者。When using RDP, only active RDP sessions are considered as logged on users.

用於管理重新開機的登錄機碼Registry keys used to manage restart

下表列出與用來控制 Windows 10 中更新後重新開機的群組原則設定相對應的登錄值。The following tables list registry values that correspond to the Group Policy settings for controlling restarts after updates in Windows 10.

HKLM\Software\Policies\Microsoft\Windows\WindowsUpdateHKLM\Software\Policies\Microsoft\Windows\WindowsUpdate

登錄機碼Registry key 機碼類型Key type Value
ActiveHoursEndActiveHoursEnd REG_DWORDREG_DWORD 0-23︰將使用時間設定為在特定小時結束0-23: set active hours to end at a specific hour
於上午 12 點 (0) 開始並於下午 11 點 (23) 結束starts with 12 AM (0) and ends with 11 PM (23)
ActiveHoursStartActiveHoursStart REG_DWORDREG_DWORD 0-23︰將使用時間設定為在特定小時開始0-23: set active hours to start at a specific hour
於上午 12 點 (0) 開始並於下午 11 點 (23) 結束starts with 12 AM (0) and ends with 11 PM (23)
SetActiveHoursSetActiveHours REG_DWORDREG_DWORD 0︰停用在使用時間以外進行更新之後自動重新開機0: disable automatic restart after updates outside of active hours
1︰啟用在使用時間以外進行更新之後自動重新開機1: enable automatic restart after updates outside of active hours

HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AUHKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU

登錄機碼Registry key 機碼類型Key type Value
AlwaysAutoRebootAtScheduledTimeAlwaysAutoRebootAtScheduledTime REG_DWORDREG_DWORD 0︰停用在已排程的時間安裝更新之後自動重新開機0: disable automatic reboot after update installation at scheduled time
1:在排定的時間更新安裝之後啟用自動重新開機1: enable automatic reboot after update installation at a scheduled time
AlwaysAutoRebootAtScheduledTimeMinutesAlwaysAutoRebootAtScheduledTimeMinutes REG_DWORDREG_DWORD 15-180︰設定自動重新開機在指定分鐘術後進行15-180: set automatic reboot to occur after given minutes
AUOptionsAUOptions REG_DWORDREG_DWORD 2:通知下載並通知安裝更新2: notify for download and notify for installation of updates
3:自動下載並通知安裝更新3: automatically download and notify for installation of updates
4︰自動下載並排程更新的安裝4: Automatically download and schedule installation of updates
5︰允許本機系統管理員進行這些設定5: allow the local admin to configure these settings
注意︰ 若要設定重新開機的行為,將這個值設定為 4Note: To configure restart behavior, set this value to 4
NoAutoRebootWithLoggedOnUsersNoAutoRebootWithLoggedOnUsers REG_DWORDREG_DWORD 0︰停用如果使用者已登入則不重新開機0: disable do not reboot if users are logged on
1︰如果使用者已登入不在安裝更新之後重新開機1: do not reboot after an update installation if a user is logged on
注意: 如果停用:自動更新會通知使用者,電腦會在 5 分鐘內自動重新開機以完成安裝Note: If disabled: Automatic Updates will notify the user that the computer will automatically restart in 5 minutes to complete the installation
ScheduledInstallTimeScheduledInstallTime REG_DWORDREG_DWORD 0-23︰將更新安裝時間排程為特定小時0-23: schedule update installation time to a specific hour
於上午 12 點 (0) 開始並於下午 11 點 (23) 結束starts with 12 AM (0) and ends with 11 PM (23)

控制重新開機行為有三種不同的註冊表組合:There are three different registry combinations for controlling restart behavior:

  • 若要設定使用時間,SetActiveHours 應該是 1,而 ActiveHoursStartActiveHoursEnd 應該定義時間範圍。To set active hours, SetActiveHours should be 1, while ActiveHoursStart and ActiveHoursEnd should define the time range.
  • 若要排程特定的安裝和重新開機時間 ,AUOptions應為 4,ScheduledInstallTime 應指定安裝時間,而AlwaysAutoRebootAt ScheduledTime設為******** 1,AlwaysAutoRebootAt ScheduledTimeMinutes應指定重新開機前等待的分鐘數。 ****To schedule a specific installation and reboot time, AUOptions should be 4, ScheduledInstallTime should specify the installation time, and AlwaysAutoRebootAtScheduledTime set to 1 and AlwaysAutoRebootAtScheduledTimeMinutes should specify number of minutes to wait before rebooting.
  • 若要在使用者登入時延遲重新開機,AUOptions 應該是 4,而 NoAutoRebootWithLoggedOnUsers 要設為 1To delay rebooting if a user is logged on, AUOptions should be 4, while NoAutoRebootWithLoggedOnUsers is set to 1.