For patching we cannot use force reboot due to the multiple shifts we have.  I push patches but I want to schedule reboots for like 1 or 2 in the morning.  Any way to create some sort of smart label and schedule to accomplish this?

 

I'm working on getting my networking team to setup Wake On LAN so I can change my patching schedules but until that is done I need another way to make sure patches are getting done and machines are being rebooted.

Answer Summary:
Create a smart label with this SQL query and have a reboot script run against that label on the same day(s) as you run patching but at 2AM...make sure you set a delay on the shutdown -r (Restart) command as per this Solution Article: http://www.kace.com/support/resources/kb/solutiondetail?sol=SOL111291 select NAME, IP, LAST_SYNC, UPTIME from MACHINE join KBSYS.KONDUCTOR_TASK KT on KT.KUID = MACHINE.KUID and KT.TYPE like 'patch%' and KT.PHASE ='reboot pending' order by MACHINE.NAME
Cancel
2 Comments   [ + ] Show Comments

Comments

  • As a stop gap you could target the same label or group of machines you are using for patching with the built in script called Shutdown a Windows System but modify the command from the shutdown -s to a shutdown -r
    • I only want ones that need reboots to get rebooted. Not just a wholesale reboot the environment type script. I also don't want the script to reboot a machine if it misses the window. I've noticed if I set a schedule and the machine is off when the machine turns on it sees the schedule is in the past and reboots again. That is a real PITA and I don't want that to happen.
      • Do you have the box selected that states Run on next connection if offline?
        You would most likely need to do some custom sql work to get the label to identify the machines that are pending reboot. There is a report in the patching category that shows computers pending reboot you could use some of that code.
      • I make sure that is not checked. I guess I'm just going to wait until the network team gets WOL setup. My issues will all go away as I will just power on all the desktops, patch and then shut them all down.
  • I have created this patch label via copy/paste and it seem to be catching every machine.
Please log in to comment

Answers

2

Create a smart label with this SQL query and have a reboot script run against that label on the same day(s) as you run patching but at 2AM...make sure you set a delay on the shutdown -r (Restart) command as per this Solution Article: http://www.kace.com/support/resources/kb/solutiondetail?sol=SOL111291

select NAME, IP, LAST_SYNC, UPTIME

from MACHINE

join KBSYS.KONDUCTOR_TASK KT on KT.KUID = MACHINE.KUID and KT.TYPE like 'patch%' and KT.PHASE ='reboot pending'

order by MACHINE.NAME
Answered 09/26/2013 by: easterdaymatt
Seventh Degree Black Belt

  • Thanks!
  • I am unable to locate the option to Create a smart label with this SQL query? Please help!
Please log in to comment
Answer this question or Comment on this question for clarity

Share