I have created a 2 state Unit Monitor using the Community Powershell MP. However the state isn’t changing (and therefore alerting). The script is based on the Get-PendingReboot function written by Brian Wilhite. My intention is to replace the Aquilaweb Pending Reboot MP that is VBS based.

Script is here:


The Unit Monitor:

  • Targets “Windows Server Operating System”
  • Is disabled by default
  • Runs every 5 mins (for testing)
  • Is unhealthy if Property[@Name=’RebootPending’] Equals Yes
  • Is healthy if Property[@Name=’RebootPending’] Equals No

I have an override that enables for all objects of class “Windows Server Operating System”

If I check health explorer I can see the monitor in a healthy state, however if I run the script locally on a system (and uncomment the line so to return the property bag), I get no script errors and can see in the XML that the RebootPending value is Yes.

I was originally work with Boolean values, however in troubleshooting have change all of the propertybag values to use strings (and have verified that they are indeed strings).

With no errors showing anywhere i’m running out of ideas!

Chris Mackenzie selected answer