Automatic Restart of Windows Server 2012R2 after Windows Update

automatic-updateswindows-server-2012-r2windows-update

I have a Windows Server 2012R2 which is set to have the Windows Updates Scheduled at a certain time.

However, this week, I received a 15 minute countdown from the moment I signed in instead of straight after the Windows Update. This therefore happened during office hours which is not ideal.

I can't see any Group Policies configured in Computer Configuration / Administrative Templates / Windows Components / Windows Update: They all show at Not Configured.
enter image description here

The registry setting AlwaysAutoRebootAtScheduledTime in HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU is set to 1 and AUOptions is set to 4.
enter image description here

There were some disconnected administrator sessions at the time of the update:

  1. Could this be the cause?
  2. Does AlwaysAutoRebootAtScheduledTime only work if no administrator sessions are active?

Best Answer

Off-topic: To check the group policies, you should use rsop.msc. I think what you're showing is the output of gpedit.msc.

Firstly, let's dive into the 2 points mentioned in the question:

AlwaysAutoRebootAtScheduledTime: When this registry value is set to 1, you are still notified of the upcoming automatic restart on the sign-in screen. However, at the end of the two-day period, the 15-minute counter begins even if the computer is locked. The restart also occurs even if the computer is locked.

NoAutoRebootWithLoggedOnUsers: To prevent Automatic Updates from restarting a computer while users are logged on, the administrator can create a NoAutoRebootWithLoggedOnUsers registry value.

This setting is complicated to explain in few words and so I'd suggest you to better go through the shared link. A sample comparison taken from MSDN is shared below:

enter image description here

Now, Coming to the main questions:

  1. Does AlwaysAutoRebootAtScheduledTime only work if no administrator sessions are active?

In the settings of AU shared by you, the AlwaysAutoRebootAtScheduledTime is enabled (set to 1). When this registry value is set to 1, you (any user) are still notified of the upcoming automatic restart on the sign-in screen. However, at the end of the two-day period, the 15-minute counter begins even if the computer is locked. The restart also occurs even if the computer is locked.

  1. There were some disconnected administrator sessions at the time of the update. Could this be the cause?

Here, NoAutoRebootWithLoggedOnUsers is disabled OR not configured in your server. So, please go through the shared cases of this setting not enabled as per the image shared above in the answer.

But, when you'll check the always auto reboot setting to be enabled, and then the NoAutoRebootWithLoggedOnUsers setting disabled (or not configured), both settings imply that anyway, at the maximum, after 2 days notification expiry, the system could have been expected to restart automatically even when the administrator session was disconnected (locked or signed out).

I suspect this is what might have happened*. After the administrator session disconnected (and / or other users not logged on), the system restarted automatically. At max, the setting would have restarted the server at the 2nd day of disconnect of session.

* NOTE: For exact event schedule, you need to confirm it with the event viewer logs. I hope this answers your question and solves the query.