Can I have SCCM do reboots 'exactly' at the end of Maintenance Windows.

Peter Franken 21 Reputation points
2022-12-02T11:11:14.437+00:00

I'm managing devices in production environments of multiple factories. We need to have 'exact' and 'predictable' reboot moments for all the servers to minimize the impact on production processes.
At this moment I manage this via scheduled tasks, but it is a nightmare to keep that in sync with SCCM's Maintenance Windows. I did create scanning scripts and reports to warn me about mismatches, but still, the work feels 'double'.

I've seen old posts mention the creation of special scripts, but having something more 'native' to SCCM would be so much better.
I hope they will build it some day.
I just learned of the 'Offset Days' option. That one is really nice too. This 'reboot' control would really make my xMas ;-)

Does anyone know of the best way to do this using SCCM's methods?

Regards,
Peter

Find words: Shutdown, Reboot, Startup, Countdown, Restart, Exact, Timed, Schedule, Interval, SCCM, Deployment

Microsoft Security | Intune | Configuration Manager | Other
0 comments No comments
{count} votes

Accepted answer
  1. Sherry Kissinger 5,531 Reputation points
    2022-12-02T18:09:00.053+00:00

    There isn't a "native" way (as far as I know) to have the client itself know to trigger at "exactly 1 second before the end of my service window, run "this", whatever "this" is". Where in your situation, that just so happens to be a reboot.

    I can think of dreaming up some custom methods, but I don't know if they would be any more or less complex than what you already have.

    One fevered dream (keeping in mind I have zero code on how to do this, just thinking as I type that 'maybe this is possible')...

    • A powershell script to LOCALLY check the known service windows on the client. (ccm_servicewindow in root\ccm\policy\machine\actualconfig I think? )
    • Compare the end date/time of the known service windows against "current date and time" (that could be cough fun to code), and if within say... 30 minutes of the end of the service window, calculate the seconds between 'now' and end of service window, and do a shutdown.exe -t <seconds as calculated> /c "some message".

    The trick would be scheduling that to run, and run frequently enough to trigger... and... do you want it to only run if there is a pending reboot? or just reboot every single time the end of the service window is approaching? So who knows how much additional logic you'll need to add into that script.

    In my twisted brain, I would think that once you have that logic solid (that alone would be a long testing process I would think), then you'd use whatever method you want to have it re-run frequently. Like a Baseline/CI, or a packag/program/advertisement, where it reruns every 30 min ? The problem(s) might be that if, for example, CM is currently installing something, the advert might not trigger, because CM is already busy.

    Or, if there is a pending reboot... the advert might not trigger because it's waiting for the reboot to finish before the advert will run (catch-22).

    Lots of potential failure points here, in logic especially, and in trying to second guess what CM the client will be doing depending upon what other tasks have just been done.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.