SimpleHelp Alerts based on registry

I am trying to get alerts on what servers I have that need reboots or have reboots pending.
I figured I would do this via the registry by looking for keys like:
HKLM\Software\Windows\CurrentVersion\Component Based Servicing\RebootPending

Problem is I cant seem to get SimpleHelp to alert on any registry key much less the one I want.
Is the formatting I have wrong?
I tried HKLM, HKEY_LOCAL_MACINE etc…
I also noticed everytime I go back into the alert after I have it set, it always changes to “Check for data of a value” instead of “Check if named value exists” or key exists.

Has anyone seen this? Am I doing something wrong?
can someone test and verify for me?

Hey @Darrell_Swafford did you get anywhere with this?

I can’t confirm the result (since I don’t have a machine that matches the criteria yet), but I can confirm the same experience that it always bounces back to “Check the data for a value” regardless of what I actually select - might be worth raising this with support.

It would be really nifty if this could work using the built in monitor, but if this fails I guess it could be done in PowerShell with the next action based on the exit code?

nope, I got no where. Also got side tracked.
I did just send it to support.

Thanks @Darrell_Swafford. How do you plan to handle reboots? I was thinking of just sending a pop up telling them a reboot is pending with a button to restart now or say not now.

Ideally, I’d then get it to pop up every $x hours so they get nagged every once in a while if they haven’t rebooted, but I’m a bit concerned that maybe a false positive would get raised somehow… it would be fine to present this one per week in error - I’m assuming these reg keys are reliable and this is where Windows gets its info from, but haven’t been able to find documentation to know for sure.

Windows is supposed to handle this on its own. Reboot not during use after hours etc.

So this is just for the technician being able to follow up and check to make sure it actually worked. If not, then run after hours manually. I don’t envision this being interactive with the user, only the technician.

As far as the registry keys, yes , they are reliable. There are multiple registry keys for different types of reboots. I monitor them on my one corporate places I work for that uses PA Server Monitor

What I have been finding is that sometime windows will get stuck when 2 types of reboots need to happen at the same time. example: File change reboot and windows update reboot. Or that a reboot may get scheduled, but a running program prevents it from rebooting at the proper time.
So monitoring it via third party/ simplehelp, the technician will get insight to why it needs a reboot, if it needs reboot. When it was supposed to happen, if it happened, and if not, manually force it too by hand when appropriate.

Hope I explained properly . If you need more info feel free to ask.

Just got a reply from support. They did find a bug with the registry section. They making an update available soon.

This seems to be working now after update to 5.2.11

Also working on a powershell script. 1 of many referenced used: https://adamtheautomator.com/pending-reboot-registry-windows/

Here is what I have so far. If anyone wants to test and give feedback and update it, I would appreciate it. Not sure I need to check for file renames since those seem to be running true alot. Could be an error in my code. Also, Reboot for pending updates is marking as true although when I check windows updates it doesnt say any are pending or applied. So most likely an error in my code as well.

function Test-RegistryKey {
[OutputType(‘bool’)]
[CmdletBinding()]
param
(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$Key
)

$ErrorActionPreference = ‘Stop’

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

}else {
$false }
}

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

}else {
$false }
}

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

}else {
$false }

}
write ‘Component Reboot Pending’
Test-RegistryKey -Key ‘HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending’
Write ‘Component Reboot in Progress’
Test-RegistryKey -Key ‘HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootInProgress’
Write ‘Windows Autoupdate Reboot Required’
Test-RegistryKey -Key ‘HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired’
write ‘Component Package Reboot Pending’
Test-RegistryKey -Key ‘HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\PackagesPending’
write ‘Windows Autoupdate post reboot’
Test-RegistryKey -Key ‘HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\PostRebootReporting’
write ‘Pending file rename 1’
Test-RegistryValueNotNull -Key ‘HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager’ -Value ‘PendingFileRenameOperations’
write ‘Pending file rename 2’
Test-RegistryValueNotNull -Key ‘HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager’ -Value ‘PendingFileRenameOperations2’
write ‘Runonce Reboot required’
Test-RegistryValue -Key ‘HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce’ -Value ‘DVDRebootSignal’
Write ‘Reboot Attempts’
Test-RegistryKey -Key ‘HKLM:\SOFTWARE\Microsoft\ServerManager\CurrentRebootAttempts’
write ‘Reboot to join domain’
Test-RegistryValue -Key ‘HKLM:\SYSTEM\CurrentControlSet\Services\Netlogon’ -Value ‘JoinDomain’
write ‘Reboot avoice spn set’
Test-RegistryValue -Key ‘HKLM:\SYSTEM\CurrentControlSet\Services\Netlogon’ -Value ‘AvoidSpnSet’
write ‘Reboot to change computer name’
(Get-ItemProperty -Path ‘HKLM:\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName’).ComputerName -ne
(Get-ItemProperty -Path ‘HKLM:\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName’).ComputerName
write ‘Reboot for pending updates’

if (Get-ChildItem -Path ‘HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Services\Pending’) {
$true
}else {
$false }

write ‘Windows update reboot now’
if (Get-ItemProperty -Path ‘HKLM:\SOFTWARE\Microsoft\Updates’ -Name ‘UpdateExeVolatile’ | Select-Object -ExpandProperty ‘UpdateExeVolatile’ -ExcludeProperty ‘0’) {
$true
}else {
$false }

Is this working? 20 characters…

The registry tool works in simplehelp. The bug is fixed. However How windows reports if it needs a reboot does not seem consistent. The script works. BUT, a windows update could take place and need a reboot, but because the update did not specifically request a reboot it wont say its a windows update reboot. Most of the time it falls under Component reboot or file change reboot.
Thats kind of annoying but the reboot script does seem to work.

I’ll get myself updated to 5.2.11 and give it a try - thanks for putting in that bug report, I’m sure I’ll need this at some point down the line even if this all gets done in PS!

If you seem to find anything that reports consistently for detailed reboots let me know.