Jump to content

koticus

Members
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

My Information

  • Location
    USA
  • Agent Count
    1500 - 2000 Agents
  1. As the title implies, this is a script I created to prompt users to reboot. It allows them to defer for 4 hours at a time for a total of 48 hours (this can all be adjusted in the script), and then gives the user a warning that the PC is about to be restarted to finish installing updates, and that they have 5 minutes to save their work. Again, this is adjustable in the script. I used script math to increment a variable named @count@ every time the script is run, and to skip to the final message when @count@ >= 12. The script also checks for the agent's uptime, to ensure that the user isn't forced to reboot if they manually restart their PC after the final warning, but before the 5 minute sleep timer can expire. To use this, I've created a group called Uptime >= 14 Days. This group uses an auto-search I created to automatically add machines that meet the criteria (uptime >= 14 days, not a server) and is limited by the search. That way, machines that are rebooted are automatically removed from the group, as their uptime no longer reports >= 14 days. This reboot script is then scheduled to run against that group every two days at 8am in the morning. I set it up for every 2 days, rather than every 1, in the hopes that it would ensure the script isn't run a second time before the first one can finish. Also, I'm not concerned about a PC being up an extra day or two, as long as it is getting rebooted about every 14 days. I am no scripting guru, so I'm sure this can be improved upon. Still, I hope this is useful to someone. Workstation Reboot with Prompts (48h deferral)).xml
×
×
  • Create New...