Windows 2003 Server Restarts when logging off from RDP

patch-managementrdpwindows-server-2003wsus

We often RDP into our servers. Sometimes if we end the RDP session via Start, Shutdown, Log-off, the server restarts.
It seems to happen when the server is waiting for a report due to a patch pushed out via WSUS, but we may be waiting for a maintainence window before rebooting.
Nothing quite like the cold-sweat when you notice that your production SQL Server or Exchange mail store is rebooting in the middle of the day!

Our work around is to just disconnect, not log off, but this causes issues with the next user who needs to log in.

Best Answer

I found this article mentioning a registry entry which could be the culprit:

With scheduled updates, administrators will be given a five-minute interval to decide whether to postpone installation, once the update files are downloaded (which will delay it until the next restart or scheduled interval -- depending on registry settings). If the installation requires a reboot (which is frequently the case) a user will be presented with a modal (i.e., positioned in front of the other windows) dialog box reminding her of the need to reboot (by default, the reboot will not be forced, although this can be changed by modifying the registry entry).

HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\
    Windows\WindowsUpdate\AU\NoAutoRebootWithLoggedOnUsers

The logoff could trigger the postponed automatic reboot.

See also this blog post: "Is Windows Automatic Update Client rebooting your system unexpectedly? Read this to “fix” it…".