Windows Reboot Script

Windows Reboot Script

If you manage Windows machines in any kind of organizational environment, you’ve probably dealt with the same headache I have — users who never reboot, systems sitting at 30+ days uptime, and then something breaks or patches can’t apply because nobody’s restarted in a month. I got tired of chasing it manually, so I built a PowerShell script to handle it.

windows_reboot_script is a lightweight PowerShell script that monitors system uptime and pops up a branded WinForms dialog prompting the user to restart once a configurable threshold is hit. It runs silently in the background — no console window — and only surfaces when it needs to say something.

The dialog shows the current uptime, a live countdown timer, and gives the user the option to postpone. But they can’t postpone forever — $MaxPostpones caps how many times they can kick the can down the road before it just does it. Every interaction gets logged to a timestamped log file, so you’ve got a paper trail of who postponed, when, and when the system actually rebooted.

Configuration lives at the top of the script and is dead simple:

  • $ThresholdDays — how many days of uptime before the dialog fires (default: 5)
  • $MaxPostpones — max number of postponements allowed (default: 3)
  • $CountdownSeconds — how long before it auto-restarts if ignored (default: 300)
  • $LogoPath — drop your org’s PNG logo in and it’ll show up centered at the top of the dialog, scaled automatically

If you’d rather work in hours or minutes instead of days, the README covers the quick variable swap to make that happen.

Deployment is GPO-friendly by design. Drop the script on a network share or push it to a local path, set up a Scheduled Task in Group Policy to run it on a recurring schedule, and you’re done. Runs on Windows 10/11 with PowerShell 5.1 and standard .NET Framework — no additional dependencies.

The repo is up on GitHub if you want to grab it, take a look at the code, or suggest improvements. It’s still pretty early but it’s been working well in my environment.

:link: GitHub - acebmxer/windows_reboot_script · GitHub