In my environment, it was decided that we would reboot all PCs once a week. The merits of this are intensely debated on the internet, so this may not be the right route for your organization to take, but it definitely does serve some valid purposes in our opinion.
- Ensures that all PCs are regularly rebooted
- Ensures that all PCs are in a state that will allow upgrades of third-party software (Java, for example) that will fail if the software or other certain applications are running
- Eliminates the user-side guesswork of whether this is the week their computer will reboot for patching; through a series of Powershell scripts, we send an email to each of our offices at 1:15pm local time every Tuesday (right around when most people are getting back from lunch) to remind them that their computer will reboot overnight
Like I said, there are many people who see this as unnecessary or detrimental, but others who think it’s a great idea. For the most part, we’re in the latter camp. In order to set this up, I first created a collection with a Maintenance Window from 10pm Tuesday night until 3am Wednesday morning. It is very important that you have a Maintenance Window configured before you set up these forced reboots, otherwise machines that are already powered off before the users left for the night will reboot themselves when powered back on the next day.
To set up the forced reboot advertisement:
- Create a new package called “ForcedReboot”
- Right-click Programs and select New > Program.
- I named mine simply “ForcedReboot”. Set Start In to c:\windows\system32, and set After Running to Program restarts computer.
- My command line is shutdown.exe -r -t 300 -c “Initiating scheduled reboot for system maintenance. You have 5 minutes to save your work before mandatory forced reboot.” This gives a reboot with 5 minutes of lead-time, and displays the message in quotes to any users who may still be logged in.
- Create an advertisement with a mandatory advertisement a little bit into your Maintenance Window (you want to give yourself some time to run things before the reboots if necessary). I advertise this to the same collection I use for Microsoft Updates. Set it to recur every 1 week the night of your Maintenance Window. You’ll also need to change the Program Run Behavior of the advertisement to Always Rerun Program.
It’s important to note that your clients will not reboot at exactly the time you set the advertisement for. For example, if you have it set to run at 10:30pm, but have a Countdown Notification Length of 5 minutes, your machines won’t reboot until 10:40pm (advertisement time + Countdown Notification Length + lead time built into the command line). Also important to note: users with administrative privileges can execute a shutdown /a to abort the shutdown, but only after the Countdown Notification has ended.