3

Server Manager in Windows Server 2008 R2 occasionally displays the warning: Console cannot refresh until computer is restarted, and in this state you cannot use Server Manager for adding or removing roles/features.

It is clear that this is related with roles/updates install processes which need a reboot for completion (e.g. to replace file in use or something similar). How can I determine the cause of this status more precisely?

Sometimes, in multi-user (or should I say multi-admin) environments, you don't know which changes were made by your colleagues and it is always better to know why you are going to reboot your server.

  • 1
    and it is always better to know why you are going to reboot your server. Because you need to isn't a good enough reason? Anyway, having admins leave your server in a reboot-pending state makes me think you need better admins, and some form of change management. – HopelessN00b Apr 3 '14 at 11:37
  • A little bit of explanation: Let's say I decided to add some features and run into this "Pending reboot status" state - not caused by my previous changes but rather by other people / Windows Update. So system asks me for reboot preventing me of doing what I want. In such cases I want to do a quick check on system instead of long investigation / questioning other people. Change management is a must, but there are also servers in relaxed change management mode like those in UAT or test environments, where change could be made almost on the fly... – Mikhail Apr 3 '14 at 12:58
4

This isn't really possible, at least not with the level of detail that you want, because Windows simply doesn't record that level of detail on why a reboot is needed. Also, as I said in my comment above, this seems to point at some pretty serious underlying issues in your environment that you should address - lack of change controls and bad administration practices.

Having said that, Windows tracks the pending reboot status in the registry, and there's a two-part blog series on Technet's Scripting Guy blog about how to use PowerShell to determine this status, which conveniently shows you where to look manually for these flags as well. (They're in the registry, surprise, surprise).

From Part I:

  1. Registry: PendingFileRenameOperations
    • Under HKLM\SYSTEM\CurrentControlSet\Control\Session Manager, if there is a value named PendingFileRenameOperations, it will contain a list of files that need to be renamed on reboot.

  2. Registry: WindowsUpdate\Auto Update
    • HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update, if there is a value named RebootRequired, a reboot is pending.

  3. Registry: Component-Based Servicing
    • Looking for the key HKLM\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending

  4. WMI: CCM_ClientUtilities (System Center Configuration Manager clients only)
    • System Center Configuration Manager 2012 must be installed on the client. When it’s installed, the ‘ROOT\ccm\ClientSDK’ WMI class will be available. This class has a method called DetermineIfRebootPending.

If you prefer to just grab the PowerShell script, that's here, in Part II.

| improve this answer | |
  • +1, PendingFileRenameOperations is usually the most common IME. I recommend just spending the few minutes to reboot instead of deleting the key though, especially since in most cases servers are setup so they don't need rebooting after most patches. – MDMoore313 Apr 3 '14 at 12:54
  • The Scripting Guy link is now broken and redirects to their main page. – Thomas Jun 10 '16 at 23:47
0

https://blogs.technet.microsoft.com/heyscriptingguy/2013/06/11/determine-pending-reboot-statuspowershell-style-part-2/

here is the updated link and script

https://gallery.technet.microsoft.com/scriptcenter/Get-PendingReboot-Query-bdb79542

| improve this answer | |
  • Link-only answers aren't particularly helpful long-term, because the resources they link to can move or disappear. Please put at least a short explanation of your answer into the answer itself. – womble Jul 6 '16 at 23:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.