r/SCCM • • 2d ago

OSD Task Sequence breaks when "Install Software Updates" step is added

I'm deploying only Windows Server 2022 and 2025 via OSD task sequences.

I have a task sequence that works perfectly. To automate patching during deployment, I adjusted a few steps to get the "Install Software Updates" step working. Everything runs as expected, the updates install, but then the server gets restarted by the updates themselves, which breaks the task sequence. The sequence never resumes: the remaining steps (unrelated to updates) never run, and I'm left with the C:_SMSTaskSequence folder.

If I remove the "Install Software Updates" step, the task sequence completes normally and the folder is cleaned up properly.

So it seems the updates trigger a reboot outside of the task sequence engine's control, and the TS can't resume afterward.

My questions:

Has anyone successfully automated software updates during OSD in a different way, for example with a PowerShell script (invoking WUA or UsScanForUpdates-style logic) that installs updates and handles the reboot inside the task sequence?

Am I missing a supported way to make the built-in "Install Software Updates" step survive update-initiated reboots? I'm aware of the usual recommendations (proper boundary groups, MP/SUP availability in the deployed OS, no GPO or deployment enforcement forcing a restart during the TS), but so far the step still breaks the sequence.

As an alternative, I know I can keep my WIM images patched via "Operating System Images" → Schedule Updates. Is that the generally recommended approach for staying current, rather than patching during the TS?

Thanks,

7 Upvotes

17 comments sorted by

29

u/Unusual-Biscotti687 2d ago

This step has always been broken. Don't. Use an up to date base .wim and ensure your install application steps use up to date versions.

10

u/Peteostro 2d ago

Microsoft updates wth Windows iso’s every month (usually 2 weeks after patch Tuesday) with the newest patches. Just download the new iso, import it into CM, distribute it, and edit the OSD task to use the new one. Pretty simple

1

u/DontFray 1d ago

Hey. Any reason you wait 2 weeks when you can just dism it yourself?

1

u/Peteostro 1d ago

No, have other things to do than to hunt down the Windows Update packages, inject them into the wim and reimport it. World won’t end if a tech images a system up without the month updates immediately.

2

u/hurkwurk 2d ago

This... so much this. we've tried three times over 10 years to get this crap to work. even tried a recommended work around of setting up a completely separate WSUS server for bench machines to get updates from, which did work since it basically avoided the entire MECM method, but ultimately abandoned it as a waste of management time. As Peteostro said already, update your ISOs every month or 3 and then just make sure your monthly patching will catch up your imaged systems within a day or two. if you are really concerned, there are ways to setup your bench's IP range to have a full time maintenance window and have your techs manually trigger updates after imaging so the machine is fully up to date before delivery.

11

u/The-Snarky-One 2d ago

That step has been wonky from the get-go and we decided to remove it years ago.

4

u/Unusual-Biscotti687 2d ago

And I should add - offline image servicing doesn't work any more and hasn't for some time because it depends on full update .cab files quite different from the modern update files WSUS and SCCM software updates now use.

3

u/WhatLemons 2d ago

You can successfully use the Software Updates step in your Task Sequence however you need to tell Configuration Manager how long to wait after restarting to wait for a second reboot before continuing.

Create a Task Sequence variable step just before your Software Update step and set the SMSTSWaitForReboot Task Sequence variable to however many seconds you want to wait before the Task Sequence continues. In my Task Sequences this is set to 20 minutes, however you can adjust it higher or lower depending on your environment. After the Software Update step set SMSTSWaitForReboot Task Sequence Variable back to 0.

Sources:

https://learn.microsoft.com/en-us/troubleshoot/mem/configmgr/os-deployment/task-sequence-fails-multiple-restarts

https://learn.microsoft.com/en-us/intune/configmgr/osd/understand/task-sequence-variables#SMSTSWaitForSecondReboot

2

u/Reaction-Consistent 2d ago

We stopped using the install software update step for just that reason, we tried adding multiple steps separated by pauses, reboot, etc., but could never get it to properly finish the task sequence. What you could do is just create a collection that newly imaged servers gets automatically added to using a direct membership, you can run the script directly from the task sequence, you can use the admin surface, you can use a scheduled task, triggered on the completion of the task sequence. Many ways to do it.

2

u/AtlAntA118 1d ago

I tried to split the TS in 2 seperate ones to make this work. The first one ends with the updaes. The second one starts about an hour later. Works sometimes but not reliable. As others suggested its better to just use an up to date iso.

1

u/nodiaque 2d ago

Last time I had that problem, it was because of the "setup configmgr step". In the parameters, I had to put the full management point address with https

1

u/CmdrDTauro 2d ago

Don’t

1

u/jl9816 2d ago

I newer got wuauclt/ usoupdate etc to work.

But powershell actually works and force search and install updates...

There is more options on ComObject Microsoft.Update.Session. but basic install should be something like this:

$Session = New-Object -ComObject Microsoft.Update.Session $Searcher = $Session.CreateUpdateSearcher() $Updates = $Searcher.Search("IsInstalled=0 and Type='Software'").Updates $Downloader = $Session.CreateUpdateDownloader() $Downloader.Updates = $Updates $Downloader.Download() $Installer = $Session.CreateUpdateInstaller() $Installer.Updates = $Updates $Installer.Install()

1

u/Reaction-Consistent 2d ago

I download the latest patched wim from Microsoft, which is often a few months behind in the patch level- so I created my own image patch tool that handles not only the server OS but older Windows 10 images, Windows, 11 etc. We also enable.net 3.5 in the image, inject the LCU,.net CU. The tool makes it super easy so it’s not a big deal to run it once a month, then it automatically imports the image and replicate it to a distribution group for me. The only thing I need to do at that point is add it to a test task, sequence, test it on a VM then replace the old image.

2

u/Unusual-Biscotti687 2d ago

The latest .wim is not a "few months behind" - unless you’re using a version that's out of support for Pro. They don't produce new install media after that date.