Monitor servers waiting for reboot after windows update – quick tip before Cumulative Update procedures

Facebooktwitterredditpinterestlinkedinmail

Few days ago, Microsoft has released Cumulative Update 5 to Operations Manager 2007 R2, there is a step by step guide in the technet for installing the update, yesterday I had to update costumer’s Development environment to CU5, well.. 17\40 agents didn’t failed.. and the rest ? well… one big red failed status…

While trying to install manually the agents I got some errors which pointed about windows update issue… ye, I know.. you think about “go on.. start the Windows Update Service”, so.. this is not the point, as probably you know, Operations Manager Agents couldn’t be installed\updated while there is reboot queued after installing updates from windows update, so.. great solution I’ve scripted is to create two state monitor with alert that check if the server is waiting for reboot after windows update installation.

This way before running with the CU5 I could check that all my agents will be updated and I wont need to do some extra work to fix the failed agents.

So, This is the code:

dim UpdateInfo, oAPI, oBag, Result
set UpdateInfo = createObject(“Microsoft.Update.SystemInfo”)
Result = CStr(UpdateInfo.RebootRequired)

Set oAPI = CreateObject(“MOM.ScriptAPI”)
Set oBag = oAPI.CreatePropertyBag()
if Result = “True” then
Call oBag.AddValue(“Status”,”NeedToReboot”)
else
Call oBag.AddValue(“Status”,”DontNeedToReboot”)
end if
Call oAPI.Return(oBag)

I’ve targeted the script to Windows Server… hmmm… screenshots :

the script Configure Monitor Configure Monitor

Have fun… 🙂

2 thoughts on “Monitor servers waiting for reboot after windows update – quick tip before Cumulative Update procedures

Leave a Reply

Your email address will not be published. Required fields are marked *