r/SCCM • u/_UserAgreement_ • 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,
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.
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.
1
u/ccmexec1337 1d ago
i have similar issue: https://www.reddit.com/r/SCCM/comments/1y2r143/sccm_task_sequence_fails_after_second_reboot/
i recommend use this: https://learn.microsoft.com/en-us/intune/configmgr/osd/understand/task-sequence-variables#SMSTSWaitForSecondReboot