How to Force Weekly Computer Reboots in MECM/SCCM: Fix Update Installation Issues with Automated Restart Compliance

Struggling with failed Windows updates and sluggish computers? Learn how to implement automated weekly reboots using Microsoft Endpoint Configuration Manager (MECM/SCCM) compliance settings to ensure your enterprise stays healthy and secure.

SCCMSCRIPTS

b

6/13/20252 min read

How do I get my users to reboot their computers every week?

There are a lot of ways to do this, but i have a few requirements.

  1. Use the built in Configuration Manager reboot counter

  2. Use native windows tools (i.e. PowerShell)

There are many ways to get systems to reboot. but not many that use these two rules.

I opted to use the application method and create 2 applications
First we create an application (App1) that will detect the system uptime and write data to the registry to use for the detection method. Then it will exit with code 3010 (soft reboot).
Use the following as the install and uninstall programs respectively

The next application (App2) will remove the registry used for the detection method.

Copy the application, so it has all the same settings except
Use the clearlog.ps1 as the install and uninstall program.
You will deploy App2 with a dependency of App1.

  1. PowerShell.exe -WindowStyle Hidden -ExecutionPolicy Bypass -File "WeeklyRebootCheck.ps1"

  2. PowerShell.exe -WindowStyle Hidden -ExecutionPolicy Bypass -File "clearlog.ps1"

  • Detection method:

    • Hive: HKLM

    • Key:SOFTWARE\bworld\RestartCompliance

    • Value: LastCheckTime

    • Data Type: String

WeeklyRebootCheck.ps1

clearlog.ps1

Now deploy App2 and be sure to set the user notifications to:
"Display in software Center, and only show notifications for computer restarts"
also be sure to check the box 'system restart' to occur outside of Maintenance Windows.

The application should now try to run daily, and if it has been 7 days since a reboot, then you will get a countdown to reboot.

you will see it in the software center as a perpetual 'Past Due - will be retried'