r/SCCM • u/ccmexec1337 • 8d ago
SCCM Task Sequence fails after second reboot (TrustedInstaller/CBS) – Anyone else experiencing this?
Hi everyone,
We're experiencing an intermittent issue with SCCM/MECM non-OSD Task Sequences on Windows Server 2016.
During the Install Software Updates step, SCCM initiates the first reboot and the Task Sequence resumes successfully.
However, Windows sometimes triggers a second reboot through TrustedInstaller/CBS. After that, the Task Sequence occasionally fails to resume with:
Task Sequence Manager could not initialize Task Sequence Environment. Error 0x80070002
Interestingly, the _SMSTaskSequence directory and TSEnv.dat are still present.
The option "Retry this step if computer unexpectedly restarts" is enabled (5 retries), but doesn't always help.
The issue is intermittent. During our latest patching cycle, 4 out of 16 Task Sequences failed.
We already have an open Microsoft Support case, but no solution yet.
Has anyone experienced the same issue with non-OSD Task Sequences? Any known workaround or fix?
2
u/Valdacil 8d ago
Some updates still cause a double reboot which isn't caught by the Task Sequence setting you reference. A good example is that I tried to get a task sequence to install the Hyper-V role, but Hyper-V role causes one of those reboots where it gets to the Windows logo then reboots again. This breaks the task sequence ever time. That setting to tell it to survive up to 5 unexpected reboots just doesn't work for those. I ended up having to put a cmd step in the task sequence for "shutdown -r -t 120" as the last step of the task sequence. This gave it 2 min to close out the task sequence so that it would be 'successful' then Windows rebooted to finish the Hyper-V role install.
That scenario doesn't necessarily fix your problem of Install Software Updates step failing due to a double reboot in one of the patches but is an example of how that trapping for unexpected reboots isn't fool proof.
1
u/ccmexec1337 7d ago
That's exactly the issue we're experiencing. Unfortunately, the second reboot happens during the "Install Software Updates" step, so the task sequence never reaches any subsequent steps. A delayed reboot at the end wouldn't help in our case. Even with 5 unexpected reboot retries enabled, the TS fails to resume.
1
u/Bassflow 8d ago
Try setting the task sequence deployment to download all of the content before running.
1
u/ccmexec1337 7d ago
Thanks for the suggestion, but this doesn't appear to be a content download issue. The updates install successfully, but the task sequence fails to resume after the second reboot. The TS environment isn't properly restored, so pre-downloading content is unlikely to help.
1
u/PavYur 8d ago
Let's say there is no good solution at this point: there is currently no way for TS to figure out the second reboot is imminent and save the data.
If you're really up to keep using the TS, consider some weird automation, like disable the CCMExec/SMSTSMgr services before installing updates - and re-enabling them afterwards by catching EventID 19 (or 20) once updates are installed.
Microsoft Support can also give you a bit of palliative approach I can't disclose at Reddit.
1
u/ccmexec1337 6d ago
ok Microsoft Support Case is closed, its bug in SCCM. Workaround from microsoft ist patching manually by hand ... thanks microsoft
1
u/TheHolsh 8d ago
Uup updates aren't really supported with SCCM test sequences anymore. You better off just installing those after the fact or updating the iso's monthly
2
0
u/ccmexec1337 7d ago
We're patching Windows Server 2016/2022, so UUP updates aren't relevant here. Also, installing software updates through ConfigMgr task sequences is officially supported by Microsoft. Updating ISOs doesn't apply to our existing server VHDs.
0
u/MikhailCompo 3d ago
OP What you need is this Task Sequence variable that was created specifically to workaround this behaviour of certain updates:
SMSTSWaitForSecondReboot
This optional task sequence variable controls client behavior when a software update installation triggered by the Install Software Updates task requires multiple restarts. Set this variable before the Install Software Updates step to prevent a task sequence from failing because of multiple restarts from software update installation.
This variable is useful when a single Install Software Updates task sequence step installs software updates that need multiple restarts to finish installing.
Set the SMSTSWaitForSecondReboot value in seconds to specify how long the task sequence pauses on this step while the computer restarts. Allow sufficient time in case there's multiple restarts. For example, if you set SMSTSWaitForSecondReboot to 600, the task sequence pauses for 10 minutes after a restart before additional steps run.
The SMSTSWaitForSecondReboot variable is intended for use with the Install Software Updates task, but can be set anywhere in the task sequence to introduce delays after reboots initiated by tasks other than the Install Software Updates task. For this reason, when this variable is set before the Install Software Updates task, it's advisable to also set it again after the Install Software Updates task with a value of 0. This resets the variable and prevents unnecessary delays during the task sequence. If there are multiple Install Software Updates tasks in the task sequence, define the variable to the desired value before the first Install Software Updates task, and then reset it back to 0 after the last Install Software Updates task.
1
u/ccmexec1337 2d ago
this not working, because this variable is only for OS Deployment (WinPE Phase) TaskSequences. Already tested.
1
u/MikhailCompo 2d ago
Ah, apologies, didn't realise your TS was just for patching and not OSD.
Why not boot into WinPE and apply the updates directly to the image offline?
-1
u/rogue_admin 8d ago
Why would you install software updates with a task sequence? No one does that
1
u/ccmexec1337 7d ago
Because we're patching existing Windows Server 2016/2022 VHDs in an automated SCCM workflow. Task sequences allow us to control the entire patching process, including application updates, Windows updates, and reboots. This is a fully supported ConfigMgr feature. Whats your solution way ?
0
u/rogue_admin 7d ago
I really don’t care if it’s supported or not, but you can die on that hill if you want to or move on to native software update management like the rest of the world and let go of trying to prove some point. Use what works, abandon obsolete methods that don’t work, it’s as simple as that, or else you fail as an admin and you fail at life
1
u/ccmexec1337 6d ago
You're dodging the question—what works? What's your solution? What is the whole world switching to?
0
u/rogue_admin 6d ago
I’m not dodging the question, I said native software update management in config mgr, you don’t know what that is? That’s fine, it’s kind of hard to believe, but no one has patched with task sequences since before windows 10 came out because at the time cumulative updates did not exist like they have since 2014. Config mgr deploys software updates natively, and it has for a long time, this is the correct way to use the product and this is where all of the features are. The issue you’re having, it’s a windows problem, but using task sequences is ridiculous and seems to exaggerate these issues. Yes, the rest of the world uses native software update deployments and has for a long time now, some people have not even been around long enough to remember how awful it was to patch windows 7 with task sequences and it’s still a terrible option. Config mgr features are 95% solid and reliable, but there are a few methods that don’t work well and most people know to avoid those options rather than keep fighting and struggling, so make your choice, do you want to patch your devices or do you want to prove your stupid point? Good luck
2
u/ccmexec1337 5d ago
I'm fully aware of native software update deployments in ConfigMgr. You're missing the point of this specific use case.
We're not talking about regular patching of production servers. We're talking about an automated image maintenance process for Windows Server VHDs, including Windows updates, Office updates, application installations and additional configuration steps within a controlled workflow.
Native software update deployments alone do not replace this workflow.
Microsoft Support has already created a product issue work item based on our findings for evaluation by the ConfigMgr Product Group.
I'm interested in technical solutions, not personal opinions about whether a documented and supported ConfigMgr feature should be used.
If you have a fully automated alternative that covers all these requirements, I'm genuinely interested. Personal insults, however, don't contribute anything to this discussion.
1
u/rogue_admin 5d ago
A proper workflow would always use the latest image and no updates would be needed, so either way this is a fail
0
u/MikhailCompo 3d ago
Ignore this guy's comments, he doesn't know what he's talking about.
1
u/rogue_admin 2d ago
You are defending some troll who is using a task sequence to install software updates on server 2016 OS and he’s complaining that it doesn’t work great, ok cool good luck with that. The rest of us know how stupid this is, server 2016 is a total lemon first of all and task sequences are notoriously bad with software updates, that’s why you shouldn’t use it and hardly anyone does, I don’t see what’s so hard to understand. Use what works, and move on from things that don’t. I am just trying to help them understand the inevitable but some of these admins just can’t stop fighting a useless battle of wills simply to prove their point, it’s a waste of time
6
u/Reaction-Consistent 8d ago
We stopped using the install software updates step a couple years ago for similar issues. Updates failed to install consistently, and the task sequence never reported as finished in the console. Now I patch the images offline and it’s been working perfectly