Windows is currently pending a reboot operation

I have a lot of stuff going on with my PC. I've got a hard drive disk check going it says it'll complete in 6 hours. I've got my server setup and running which is a pain to restart and have all these files open I'm working on. When I try to install a program it says "A restart of the operating system is currently pending. You must restart the system before continuing installation. Do you want to restart now?" If I restart it's going to cause a lot of pain for myself. I know this program doesn't "really" need me to restart, it's just that earlier I updated .net and so it thinks I do. The program doesn't even use .net.
  • Remove From My Forums
  • Question

  • I have a lot of stuff going on with my PC. I’ve got a hard drive disk check going it says it’ll complete in 6 hours. I’ve got my server setup and running which is a pain to restart and have all these files open I’m working on. When I try to install a program
    it says «A restart of the operating system is currently pending. You must restart the system before continuing installation. Do you want to restart now?» If I restart it’s going to cause a lot of pain for myself. I know this program doesn’t «really» need me
    to restart, it’s just that earlier I updated .net and so it thinks I do. The program doesn’t even use .net.

    How do I cancel the pending reboot?

Answers

    • Marked as answer by

      Monday, October 17, 2011 3:05 AM

Whenever you install software, updates or make configuration changes, it’s common for Windows to need a reboot. Many OS tasks sometimes force Windows to require a reboot. When a reboot is pending, Windows add some registry values to show that. In this blog post, you’re going to learn how to check for a pending reboot and how to build a PowerShell script to automate the task.

Windows Needs Rebooted

When you’re in on the console, you can notice a reboot is pending by some popup box or notification as shown below.

From that notification, you can restart Windows and be done with it. But, what if you can’t immediately reboot a machine when it needs to? What if you’ve just installed updates on a production server and that server can’t be rebooted right now?

Pending Windows reboot message
Pending Windows reboot message

The reboot must wait.

Time goes by and by then the reboot may be forgotten about altogether! By the time you realize, many servers or workstations need to be rebooted but which ones?

Pending Reboot Flags are in the Registry

A pending reboot is defined in many places. Scroll right to see the values and conditions. A Windows computer is pending a reboot if any of the conditions in this table are true.

Key Value Condition
HKLM:SOFTWAREMicrosoftUpdates UpdateExeVolatile Value is anything other than 0
HKLM:SYSTEMCurrentControlSetControlSession Manager PendingFileRenameOperations value exists
HKLM:SYSTEMCurrentControlSetControlSession Manager PendingFileRenameOperations2 value exists
HKLM:SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdateAuto UpdateRebootRequired NA key exists
HKLM:SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdateServicesPending NA Any GUID subkeys exist
HKLM:SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdateAuto UpdatePostRebootReporting NA key exists
HKLM:SOFTWAREMicrosoftWindowsCurrentVersionRunOnce DVDRebootSignal value exists
HKLM:SoftwareMicrosoftWindowsCurrentVersionComponent Based ServicingRebootPending NA key exists
HKLM:SoftwareMicrosoftWindowsCurrentVersionComponent Based ServicingRebootInProgress NA key exists
HKLM:SoftwareMicrosoftWindowsCurrentVersionComponent Based ServicingPackagesPending NA key exists
HKLM:SOFTWAREMicrosoftServerManagerCurrentRebootAttempts NA key exists
HKLM:SYSTEMCurrentControlSetServicesNetlogon JoinDomain value exists
HKLM:SYSTEMCurrentControlSetServicesNetlogon AvoidSpnSet value exists
HKLM:SYSTEMCurrentControlSetControlComputerNameActiveComputerName ComputerName Value ComputerName in HKLM:SYSTEMCurrentControlSetControlComputerNameComputerName is different

If you have the Microsoft System Center Configuration Manager (SCCM) client installed, you may also see these methods in WMI.

Namespace Class Property Value Product Notes
ROOTccmClientSDK CCM_ClientUtilities DetermineifRebootPending RebootPending SCCM ReturnValue needs to be 0 and this value is not null
ROOTccmClientSDK CCM_ClientUtilities DetermineifRebootPending IsHardRebootPending SCCM ReturnValue needs to be 0 and this value is not null

Once you know each method to check for a pending reboot, there are many different ways to check registry values. You could open up regedit.exe and manually mouse through each registry key.

Checking regedit manually
Checking regedit manually

Manually checking via the registry works but we’re human. What if you forget to check one registry path or just forget which ones to check? There’s a much better way to do this. You can create a script or function to do this for you. In my case, I prefer PowerShell so that’s what I’ll use.

By using a PowerShell script, you can query one or all computers in our domain or manually provide the server names to see if they are pending a reboot. You can then make a decision to whether to reboot them then or make a list to reboot later. The choice is yours.

To use my PowerShell method, you’ll need to ensure PowerShell Remoting is set up and available on your servers.

Testing for a a Pending Reboot (The Easy Way)

If you don’t want to learn how to check these registry keys and build a tool like this in PowerShell, I’ve made it easy for you. Simply open up your PowerShell console and type Install-Script Test-PendingReboot. Install-Script will download my PowerShell script from the PowerShell Gallery to C:Program FilesWindowsPowerShellScripts. Then run the script as shown below.

PS51> Test-PendingReboot.ps1 -ComputerName localhost

ComputerName IsPendingReboot
------------ ---------------
localhost              False

You can provide as many servers as you want via the ComputerName parameter. The script will return True or False along with the server name.

This tool checks all of the registry keys in the above table for you.

If you’d like to add conditions I’ve missed or correct any mistakes I’ve made, feel free to issue a pull request on GitHub to fix it.

If you want to learn how to build a tool like this, read on!

First, you’ll need to define all of the computers you’d like to test a reboot on. There are many different ways to do this but for this demonstration, I’ll define them manually via an array.

$servers = 'SRV1','SRV2','SRV3'

Now create a foreach loop to iterate over each of them.

foreach ($computer in $ComputerName)

}

Next, I recommend using PowerShell Remoting and checking each registry key and value condition inside of a single PSSession. Create a PSSession for every server.

foreach ($computer in $ComputerName)
    $session = New-PSSession
}

Once you have a PSSession created, you’ll then need to run the checks.

Since you’ll be running many different checks using the same code such as:

  • Testing if a registry key exists
  • Testing if a registry value exists
  • Testing if a registry value is not null

I recommend creating simple functions for each of these checks. This allows you to call a function instead of duplicating code. The Test-PendingReboot script builds all of these helper functions into a single scriptblock as shown below.

function Test-RegistryKey {
        [OutputType('bool')]
        [CmdletBinding()]
        param
        (
            [Parameter(Mandatory)]
            [ValidateNotNullOrEmpty()]
            [string]$Key
        )
    
        $ErrorActionPreference = 'Stop'

        if (Get-Item -Path $Key -ErrorAction Ignore) {
            $true
        }
    }

    function Test-RegistryValue {
        [OutputType('bool')]
        [CmdletBinding()]
        param
        (
            [Parameter(Mandatory)]
            [ValidateNotNullOrEmpty()]
            [string]$Key,

            [Parameter(Mandatory)]
            [ValidateNotNullOrEmpty()]
            [string]$Value
        )
    
        $ErrorActionPreference = 'Stop'

        if (Get-ItemProperty -Path $Key -Name $Value -ErrorAction Ignore) {
            $true
        }
    }

    function Test-RegistryValueNotNull {
        [OutputType('bool')]
        [CmdletBinding()]
        param
        (
            [Parameter(Mandatory)]
            [ValidateNotNullOrEmpty()]
            [string]$Key,

            [Parameter(Mandatory)]
            [ValidateNotNullOrEmpty()]
            [string]$Value
        )
    
        $ErrorActionPreference = 'Stop'

        if (($regVal = Get-ItemProperty -Path $Key -Name $Value -ErrorAction Ignore) -and $regVal.($Value)) {
            $true
        }
    }

Inside of that same scriptblock, define each condition referencing the helper functions you just created.

$tests = @(
        { Test-RegistryKey -Key 'HKLM:SOFTWAREMicrosoftWindowsCurrentVersionComponent Based ServicingRebootPending' }
        { Test-RegistryKey -Key 'HKLM:SoftwareMicrosoftWindowsCurrentVersionComponent Based ServicingRebootInProgress' }
        { Test-RegistryKey -Key 'HKLM:SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdateAuto UpdateRebootRequired' }
        { Test-RegistryKey -Key 'HKLM:SoftwareMicrosoftWindowsCurrentVersionComponent Based ServicingPackagesPending' }
        { Test-RegistryKey -Key 'HKLM:SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdateAuto UpdatePostRebootReporting' }
        { Test-RegistryValueNotNull -Key 'HKLM:SYSTEMCurrentControlSetControlSession Manager' -Value 'PendingFileRenameOperations' }
        { Test-RegistryValueNotNull -Key 'HKLM:SYSTEMCurrentControlSetControlSession Manager' -Value 'PendingFileRenameOperations2' }
        { 
            # Added test to check first if key exists, using "ErrorAction ignore" will incorrectly return $true
            'HKLM:SOFTWAREMicrosoftUpdates' | Where-Object { test-path $_ -PathType Container } | ForEach-Object {            
                (Get-ItemProperty -Path $_ -Name 'UpdateExeVolatile' -ErrorAction Ignore | Select-Object -ExpandProperty UpdateExeVolatile) -ne 0 
            }
        }
        { Test-RegistryValue -Key 'HKLM:SOFTWAREMicrosoftWindowsCurrentVersionRunOnce' -Value 'DVDRebootSignal' }
        { Test-RegistryKey -Key 'HKLM:SOFTWAREMicrosoftServerManagerCurrentRebootAttemps' }
        { Test-RegistryValue -Key 'HKLM:SYSTEMCurrentControlSetServicesNetlogon' -Value 'JoinDomain' }
        { Test-RegistryValue -Key 'HKLM:SYSTEMCurrentControlSetServicesNetlogon' -Value 'AvoidSpnSet' }
        {
            # Added test to check first if keys exists, if not each group will return $Null
            # May need to evaluate what it means if one or both of these keys do not exist
            ( 'HKLM:SYSTEMCurrentControlSetControlComputerNameActiveComputerName' | Where-Object { test-path $_ } | %{ (Get-ItemProperty -Path $_ ).ComputerName } ) -ne 
            ( 'HKLM:SYSTEMCurrentControlSetControlComputerNameComputerName' | Where-Object { Test-Path $_ } | %{ (Get-ItemProperty -Path $_ ).ComputerName } )
        }
        {
            # Added test to check first if key exists
            'HKLM:SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdateServicesPending' | Where-Object { 
                (Test-Path $_) -and (Get-ChildItem -Path $_) } | ForEach-Object { $true }
        }
    )

You can now create a foreach loop inside of your $servers foreach loop that reads each test executes each test.

foreach ($test in $tests) {
	if (& $test) {
		$true
		break
	}
}

When you run the code, the script returns an output like this:

ComputerName IsPendingReboot
------------ ---------------
Server1              False
Server2              True

You can create this output by ensuring the foreach loop returns a single object per server. You should know that if any of the registry values exist, then the server is pending a reboot. Knowing this, you then need to return True if any of the values exist and False if none of them exist.

Wrap all of this up into a script and it should look like this (with some minor additions like Credential).

[CmdletBinding()]
param(
    [Parameter(Mandatory)]
    [ValidateNotNullOrEmpty()]
    [string[]]$ComputerName,
	
    [Parameter()]
    [ValidateNotNullOrEmpty()]
    [pscredential]$Credential
)

$ErrorActionPreference = 'Stop'

$scriptBlock = {

    $VerbosePreference = $using:VerbosePreference
    function Test-RegistryKey {
        [OutputType('bool')]
        [CmdletBinding()]
        param
        (
            [Parameter(Mandatory)]
            [ValidateNotNullOrEmpty()]
            [string]$Key
        )
    
        $ErrorActionPreference = 'Stop'

        if (Get-Item -Path $Key -ErrorAction Ignore) {
            $true
        }
    }

    function Test-RegistryValue {
        [OutputType('bool')]
        [CmdletBinding()]
        param
        (
            [Parameter(Mandatory)]
            [ValidateNotNullOrEmpty()]
            [string]$Key,

            [Parameter(Mandatory)]
            [ValidateNotNullOrEmpty()]
            [string]$Value
        )
    
        $ErrorActionPreference = 'Stop'

        if (Get-ItemProperty -Path $Key -Name $Value -ErrorAction Ignore) {
            $true
        }
    }

    function Test-RegistryValueNotNull {
        [OutputType('bool')]
        [CmdletBinding()]
        param
        (
            [Parameter(Mandatory)]
            [ValidateNotNullOrEmpty()]
            [string]$Key,

            [Parameter(Mandatory)]
            [ValidateNotNullOrEmpty()]
            [string]$Value
        )
    
        $ErrorActionPreference = 'Stop'

        if (($regVal = Get-ItemProperty -Path $Key -Name $Value -ErrorAction Ignore) -and $regVal.($Value)) {
            $true
        }
    }

    # Added "test-path" to each test that did not leverage a custom function from above since
    # an exception is thrown when Get-ItemProperty or Get-ChildItem are passed a nonexistant key path
    $tests = @(
        { Test-RegistryKey -Key 'HKLM:SOFTWAREMicrosoftWindowsCurrentVersionComponent Based ServicingRebootPending' }
        { Test-RegistryKey -Key 'HKLM:SoftwareMicrosoftWindowsCurrentVersionComponent Based ServicingRebootInProgress' }
        { Test-RegistryKey -Key 'HKLM:SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdateAuto UpdateRebootRequired' }
        { Test-RegistryKey -Key 'HKLM:SoftwareMicrosoftWindowsCurrentVersionComponent Based ServicingPackagesPending' }
        { Test-RegistryKey -Key 'HKLM:SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdateAuto UpdatePostRebootReporting' }
        { Test-RegistryValueNotNull -Key 'HKLM:SYSTEMCurrentControlSetControlSession Manager' -Value 'PendingFileRenameOperations' }
        { Test-RegistryValueNotNull -Key 'HKLM:SYSTEMCurrentControlSetControlSession Manager' -Value 'PendingFileRenameOperations2' }
        { 
            # Added test to check first if key exists, using "ErrorAction ignore" will incorrectly return $true
            'HKLM:SOFTWAREMicrosoftUpdates' | Where-Object { test-path $_ -PathType Container } | ForEach-Object {            
                (Get-ItemProperty -Path $_ -Name 'UpdateExeVolatile' | Select-Object -ExpandProperty UpdateExeVolatile) -ne 0 
            }
        }
        { Test-RegistryValue -Key 'HKLM:SOFTWAREMicrosoftWindowsCurrentVersionRunOnce' -Value 'DVDRebootSignal' }
        { Test-RegistryKey -Key 'HKLM:SOFTWAREMicrosoftServerManagerCurrentRebootAttemps' }
        { Test-RegistryValue -Key 'HKLM:SYSTEMCurrentControlSetServicesNetlogon' -Value 'JoinDomain' }
        { Test-RegistryValue -Key 'HKLM:SYSTEMCurrentControlSetServicesNetlogon' -Value 'AvoidSpnSet' }
        {
            # Added test to check first if keys exists, if not each group will return $Null
            # May need to evaluate what it means if one or both of these keys do not exist
            ( 'HKLM:SYSTEMCurrentControlSetControlComputerNameActiveComputerName' | Where-Object { test-path $_ } | %{ (Get-ItemProperty -Path $_ ).ComputerName } ) -ne 
            ( 'HKLM:SYSTEMCurrentControlSetControlComputerNameComputerName' | Where-Object { Test-Path $_ } | %{ (Get-ItemProperty -Path $_ ).ComputerName } )
        }
        {
            # Added test to check first if key exists
            'HKLM:SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdateServicesPending' | Where-Object { 
                (Test-Path $_) -and (Get-ChildItem -Path $_) } | ForEach-Object { $true }
        }
    )

    foreach ($test in $tests) {
        Write-Verbose "Running scriptblock: [$($test.ToString())]"
        if (& $test) {
            $true
            break
        }
    }
}

foreach ($computer in $ComputerName) {
    try {
        $connParams = @{
            'ComputerName' = $computer
        }
        if ($PSBoundParameters.ContainsKey('Credential')) {
            $connParams.Credential = $Credential
        }

        $output = @{
            ComputerName    = $computer
            IsPendingReboot = $false
        }

        $psRemotingSession = New-PSSession @connParams
        
        if (-not ($output.IsPendingReboot = Invoke-Command -Session $psRemotingSession -ScriptBlock $scriptBlock)) {
            $output.IsPendingReboot = $false
        }
        [pscustomobject]$output
    } catch {
        Write-Error -Message $_.Exception.Message
    } finally {
        if (Get-Variable -Name 'psRemotingSession' -ErrorAction Ignore) {
            $psRemotingSession | Remove-PSSession
        }
    }
}

You can now execute it like this:

PS51> .Test-PendingReboot.ps1 -Server SRV1,SRV2,SRV3,etc

Summary

You should now have a quick way to test pending reboot across Windows servers. You can see that by using PowerShell, you can consolidate down many tedious steps into one script. This script allows you to quickly test for a pending reboot across many servers at once.

If you know of any other indications to check for a pending reboot, please let me know.

Hello Ricky,

I keep getting the «reboot required» with the new pending reboot detection feature

Indeed, the launch condition is triggered if a reboot is pending on the system.

There isn’t an option to see what are the rules that are checked by the launch condition. However, please allow me to try and explain this and hopefully this will help you troubleshoot the problem on your end.

As most Windows settings, a (pending) system reboot can be detected with the help of the registries. Here is a list with the values that can be manually checked to see if a system reboot is pending:

Key: HKLM:SOFTWAREMicrosoftUpdates
Value: UpdateExeVolatile
Condition: Value is anything other than 0

HKLM:SYSTEMCurrentControlSetControlSession Manager
PendingFileRenameOperations
value exists

Key: HKLM:SYSTEMCurrentControlSetControlSession Manager
Value: PendingFileRenameOperations2
Condition: value exists

Key: HKLM:SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdateAuto UpdateRebootRequired
Value: NA
Condition: key exists

Key: HKLM:SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdateServicesPending
Value: NA
Condition: Any GUID subkeys exist

Key: HKLM:SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdateAuto UpdatePostRebootReporting
Value: NA
Condition: key exists

Key: HKLM:SoftwareMicrosoftWindowsCurrentVersionComponent Based ServicingRebootPending
Value: NA
Condition: key exists

Key: HKLM:SoftwareMicrosoftWindowsCurrentVersionComponent Based ServicingRebootInProgress
Value: NA
Condition: key exists

Key: HKLM:SoftwareMicrosoftWindowsCurrentVersionComponent Based ServicingPackagesPending
Value: NA
Condition: key exists

Key: HKLM:SOFTWAREMicrosoftServerManagerCurrentRebootAttempts
Value: NA
Condition: key exists


Key: HKLM:SYSTEMCurrentControlSetServicesNetlogon
Value: JoinDomain
Condition: value exists

Key: HKLM:SYSTEMCurrentControlSetServicesNetlogon
Value:AvoidSpnSet
Condition: value exists

Important: Please test this on a virtual machine

Beside that, we can also automatically detect a pending reboot using the «PendingReboot» PowerShell module, which contains the «Test-PendingReboot» cmdlet (this script simply checks the above specified registry entries).

Here are the steps that you can follow in order to achieve it:

1. open an elevated PowerSell session.

2. Install-Module PendingReboot

3. make sure that scripts can run on the machine. By default, the execution policy may be set to «Restricted». We can change it to «Unrestricted» so we can run the script (Set-ExecutionPolicy -ExecutionPolicy «Unrestricted»).

4. Import-Module PendingReboot

5. Test-PendingReboot -detailed

That should show you the details about the pending reboot. Beside that, after the check is done, you can manually open the registry editor (win+R -> regedit.exe) and check it.

Hope this will help you troubleshoot your scenario.

Best regards,
Catalin

Use PowerShell to test if a Windows server is pending a reboot.

  • Author
  • Recent Posts

Adam Bertram is a 20-year IT veteran, Microsoft MVP, blogger, and trainer.

To prevent service interruptions, you have to schedule Windows server reboots. With the help of PowerShell, you can check whether a particular Windows server requires a reboot or not.

Unfortunately, we can’t always keep our servers up 24/7. In Windowsland especially, a reboot now and then is required. There are many different reasons a server may need a reboot, like software that needs to modify something currently running, a locked file that refuses to let go without a boot, or perhaps a service that can only apply a change at boot time.

The solution to a needed reboot is simple: reboot it! But it’s not always that simple. Servers are serving users, and users don’t like it when their services go down at any time. Also, if you manage a lot of servers, you may want to schedule a maintenance window to reboot them all at once rather than as needed. In such a case, you need to know which ones need rebooting and which ones don’t. How to determine that isn’t too clear on a Windows server.

There is no one area to look at to tell whether a Windows server needs a reboot. The flags are spread out amongst a few different registry keys. Luckily, we can use a PowerShell script to query these registry values and return a simple True or False to indicate if one or more servers need a three-finger salute.

Before we get to the PowerShell, you need to understand where to look. There are three (or more I’m not aware of) registry values you should check to see whether a reboot is needed or not.

  • The RebootPending value at
    HKLM:SOFTWAREMicrosoftWindowsCurrentVersionComponent Based Servicing
  • The RebootRequired value at
    HKLM:SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdateAuto Update
  • The PendingFileRenameOperations value at
    HKLM:SYSTEMCurrentControlSetControlSession Manager

Knowing these registry values, we then create the PowerShell code to check for them on a remote server. We’ll do this over PowerShell Remoting, so I’m assuming it is available on your servers.

The server is pending a reboot if the RebootPending and RebootRequired values exist. Let’s build some code to check for these registry values’ existence. I’m getting a little fancy here by creating an array of hash tables. I’m doing this because it makes it easier to add more checks if one day you find out you need to check other registry values. Using an array like this will allow me to loop over each test quickly.

Also, notice below I’m ignoring errors because if it throws an error, I’m going to assume the value does not exist.

$pendingRebootTests = @(
    @{
        Name = 'RebootPending'
        Test = { Get-ItemProperty -Path 'HKLM:SOFTWAREMicrosoftWindowsCurrentVersionComponent Based Servicing'  Name 'RebootPending' -ErrorAction Ignore }
        TestType = 'ValueExists'
    }
    @{
        Name = 'RebootRequired'
        Test = { Get-ItemProperty -Path 'HKLM:SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdateAuto Update'  Name 'RebootRequired' -ErrorAction Ignore }
        TestType = 'ValueExists'
    }
    @{
        Name = 'PendingFileRenameOperations'
        Test = { Get-ItemProperty -Path 'HKLM:SYSTEMCurrentControlSetControlSession Manager' -Name 'PendingFileRenameOperations' -ErrorAction Ignore }
        TestType = 'NonNullValue'
    }
)

Now that we have the code built to run the tests, let’s create a PowerShell Remoting session and run these scriptblocks on a server.

## Create a PowerShell Remoting session
$session = New-PSSession -Computer SRV1
foreach ($test in $pendingRebootTests) {
    Invoke-Command -Session $session -ScriptBlock $test.Test
}

This will run the code on all the servers but won’t return a simple True or False as we need. To do this, we need to add some if/then logic to it. Since only two of the tests need to return True or False if the registry key exists or not, we’ll use the TestType key in each hash table to make that distinction.

Subscribe to 4sysops newsletter!

$session = New-PSSession -Computer SRV1
foreach ($test in $pendingRebootTests) {
    $result = Invoke-Command -Session $session -ScriptBlock $test.Test
    if ($test.TestType -eq 'ValueExists' -and $result) {
        $true
    } elseif ($test.TestType -eq 'NonNullValue' -and $result -and $result.($test.Name)) {
        $true
    } else {
        $false
    }
}
$session | Remove-PSSession

Pending reboot test

Pending reboot test

At this point, we can get an output from this server with the results of each of the checks we’ve done. This function is also built to expand upon by adding additional servers if need be.

by Radu Tyrsina

Radu Tyrsina has been a Windows fan ever since he got his first PC, a Pentium III (a monster at that time). For most of the kids of… read more


Updated on August 27, 2015

XINSTALL BY CLICKING THE DOWNLOAD FILE

To fix various PC problems, we recommend DriverFix:
This software will keep your drivers up and running, thus keeping you safe from common computer errors and hardware failure. Check all your drivers now in 3 easy steps:

  1. Download DriverFix (verified download file).
  2. Click Start Scan to find all problematic drivers.
  3. Click Update Drivers to get new versions and avoid system malfunctionings.
  • DriverFix has been downloaded by 0 readers this month.

As part of its latest updates, Microsoft has issued one that is affecting those of you hit by the “pending restart” status that just won’t disappear. Here’s how Microsoft’s team is describing the situation:
pending restart windows 8.1

You use CHS pinyin IME on a Windows 8.1 or Windows Server 2012 R2 based computer. A new CHS IME Hot-and-Popular dictionary update is installed when you have already started to use CHS IME. In this scenario, the Pending Restart status is displayed in the status of the current HAP update even though a restart is not required.

Read Also: Solved: ‘Your Location has Recently Been Accessed’ Alert in Windows 8, 8.1

Pending Restart problems solved with update in Windows 8.1

So, just like we’ve said for plenty of other similar updates, you will just have to install the KB 2955164 file for this to work; a hotfix hasn’t been made available for download. This update is aimed at users of the following operating systems:

  • Windows 8.1 Enterprise
  • Windows 8.1
  • Windows 8.1 Pro
  • Windows RT 8.1
  • Windows Server 2012 R2 Datacenter, Essentials, Foundation, Standard

Therefore, if you have been affected by similar problems, do make sure you stay up to date and you will receive updates for some annoying issues that you don’t even suspect have been solved.

Read Also: Internet Explorer 11 Freezes at Start, Many Windows 8.1 Users Complain

Still having issues? Fix them with this tool:

SPONSORED

If the advices above haven’t solved your issue, your PC may experience deeper Windows problems. We recommend downloading this PC Repair tool (rated Great on TrustPilot.com) to easily address them. After installation, simply click the Start Scan button and then press on Repair All.

newsletter icon

Newsletter

In the world of system administration, you will eventually have a need to check if a server needs a reboot or simply check pending reboot status. After some scouring on the internet I’ve come up with a Powershell script to let me know if a server needs a reboot. The best part about it, is that it can all be done remotely. No need to RDP into multiple servers or computers and do it manually. Also, it will tell you an easy True or False if it needs a reboot. Let’s move on to the script.

If you have any questions feel fee to leave a comment and I’ll do my best to get back to you!

Remotely Check Pending Reboot Status Powershell Script

Function Get-PendingRebootStatus {
<#
.Synopsis
    This will check to see if a server or computer has a reboot pending.
    For updated help and examples refer to -Online version.
 
.NOTES
    Name: Get-PendingRebootStatus
    Author: theSysadminChannel
    Version: 1.2
    DateCreated: 2018-Jun-6
 
.LINK
    https://thesysadminchannel.com/remotely-check-pending-reboot-status-powershell -
 
 
.PARAMETER ComputerName
    By default it will check the local computer.
 
.EXAMPLE
    Get-PendingRebootStatus -ComputerName PAC-DC01, PAC-WIN1001
 
    Description:
    Check the computers PAC-DC01 and PAC-WIN1001 if there are any pending reboots.
#>
 
    [CmdletBinding()]
    Param (
        [Parameter(
            Mandatory = $false,
            ValueFromPipeline = $true,
            ValueFromPipelineByPropertyName = $true,
            Position=0
        )]
 
    [string[]]  $ComputerName = $env:COMPUTERNAME
    )
 
 
    BEGIN {}
 
    PROCESS {
        Foreach ($Computer in $ComputerName) {
            Try {
                $PendingReboot = $false
 
                $HKLM = [UInt32] "0x80000002"
                $WMI_Reg = [WMIClass] "$Computerrootdefault:StdRegProv"
 
                if ($WMI_Reg) {
                    if (($WMI_Reg.EnumKey($HKLM,"SOFTWAREMicrosoftWindowsCurrentVersionComponent Based Servicing")).sNames -contains 'RebootPending') {$PendingReboot = $true}
                    if (($WMI_Reg.EnumKey($HKLM,"SOFTWAREMicrosoftWindowsCurrentVersionWindowsUpdateAuto Update")).sNames -contains 'RebootRequired') {$PendingReboot = $true}
 
                    #Checking for SCCM namespace
                    $SCCM_Namespace = Get-WmiObject -Namespace ROOTCCMClientSDK -List -ComputerName $Computer -ErrorAction Ignore
                    if ($SCCM_Namespace) {
                        if (([WmiClass]"$ComputerROOTCCMClientSDK:CCM_ClientUtilities").DetermineIfRebootPending().RebootPending -eq $true) {$PendingReboot = $true}
                    }
 
                    [PSCustomObject]@{
                        ComputerName  = $Computer.ToUpper()
                        PendingReboot = $PendingReboot
                    }
                }
            } catch {
                Write-Error $_.Exception.Message
 
            } finally {
                #Clearing Variables
                $null = $WMI_Reg
                $null = $SCCM_Namespace
            }
        }
    }
 
    END {}
}

Get-PendingRebootStatus

How to run the Get-PendingRebootStatus script

In order to the run the script there are a couple of things you need to do.  First and foremost, you need to set your execution policy to RemoteSigned.  This is a standard with running any Powershell script.

Next you need to dot source the script since it is a function.  To dot source the script do the following:

  • Copy the script above and save it any location. In this example I’ll save it to my C:_Scripts folder.
  • Within the Powershell Window type: . ._ScriptsGet-PendingRebootStatus.ps1 – Note the two dots before the backslash.

Dot-Source Get-PendingRebootstatus
 

Hopefully this article has helped you check pending Reboot status for machines in your environment.  Let me know what you think. Also, consider subscribing to our Youtube Channel to get video demos and other related sysadmin content. While you’re at it, don’t forget to take a look at our other real world Powershell Scripts.

Hello,

I am trying to install windows-server-backup feature on windows server 2016 running exchange server 2016, after installing the feature, it shows the status, installation success, pending reboot / restart.

for two weeks now, I am searching the internet, to solve this problem, because no matter how many times I restart the server, or shut it down, still the same, now I can’t install another features or even run SFC /scannow.

I did not find in the registry the keys that many people suggested, like :

UpdateExeVolatile (I even created this one without luck)

PendingFileRenameOperations (nothing in current control set , or 001, or 002, I even made search in the registry and nothing)

I did everything in these posts:

https://community.spiceworks.com/topic/2045087-reboot-pending-whenever-i-attempt-to-install-a-feature Opens a new window

https://social.technet.microsoft.com/Forums/exchange/en-US/1103446c-d503-4f39-934f-04c47b260f78/exch… Opens a new window 

https://basics.net/2018/10/24/exchange-2016-there-is-a-pending-reboot-from-a-previous- Opens a new window

installation-o… Opens a new window

https://misstech.co.uk/2017/06/14/exchange-2016-on-server-2016-a-reboot-from-a-previous-installation… Opens a new window 

nothing, did not work, please help :(

check
Best Answer

  • Author Rod McGarrigle

    pure capsaicin

    Windows Server Expert

    • check
      240
      Best Answers
    • thumb_up
      512
      Helpful Votes

    You can’t cancel a reboot?

    If you follow the guide above, create a notepad, put something in it but do NOT save it, when you reboot it will ask you to save or cancel the file — cancel the reboot at this stage and proceed with the install.

    Do you have any GPO or packages that could stop installs?

    If this is your exchange server and it is live, I would be looking to build a second exchange server, install the features you want, migrate the users and remove the old one (correctly though).

    There is clearly issues with this server


    1 found this helpful
    thumb_up
    thumb_down

  • View Best Answer in replies below

    Read these next…

    • Curated Merging two domains with the same name?

      Merging two domains with the same name?

      Windows

      It seems that a possible company merger is coming down the pipeline, but as luck would have it, the active directory domains have the same name (ie, domain.local)The domain I maintain is running server 2019 at a 2016/2019 functional level.The other domain…

    • Curated How can I track changes to network adapter configuration

      How can I track changes to network adapter configuration

      Windows

      Ok, so we have a site where most of the users have local admin and they have a small group of users who «know about computers».  The site runs pretty smoothly but we’re seeing a bunch of users who are able to function on the wired network but aren’t able …

    • Curated Snap! -- Cooling in Antarctica, Back to the Moon, Biological Clothing, AI Sci-Fi

      Snap! — Cooling in Antarctica, Back to the Moon, Biological Clothing, AI Sci-Fi

      Spiceworks Originals

      Your daily dose of tech news, in brief.

      Welcome to the Snap!

      Flashback: February 3, 1986: The term “vaporware” is first used by Philip Elmer-DeWitt in a TIME magazine article (Read more HERE.)

      Bonus Flashback: February 3, 1966: Luna 9 Lan…

    • Curated Safety Glasses with Glasses

      Safety Glasses with Glasses

      Networking

      I’m going to be pulling some new wire soon through some dirty drop ceilings, and without fail, at some point I always get a piece of something in my eye at some point during the job.I’d like to avoid that this time.I have struggled to find safety glasses …

    • Curated AD on-premise courses

      AD on-premise courses

      IT & Tech Careers

      Hello!We have a predominantly on-prem AD environment. Whilst we will be moving to M365 that will be in a while.We have a number of junior staff that need basic instruction in Active Directory and file/folder permissions. I recall many years ago the MC…

    Понравилась статья? Поделить с друзьями:
  • Windows is checking for the solution to the problem
  • Windows is checking for memory problems что это
  • Windows is bypassing your startup files
  • Windows is an operating system which is loaded перевод текста
  • Windows is an operating system which is loaded while