r/SCCM • u/ccmexec1337 • 10d 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?
6
u/Reaction-Consistent 10d 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
2
u/Valdacil 10d 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/Bassflow 10d ago
Try setting the task sequence deployment to download all of the content before running.
1
u/PavYur 9d 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/TheHolsh 10d 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
0
u/MikhailCompo 4d ago
OP What you need is this Task Sequence variable that was created specifically to workaround this behaviour of certain updates:
SMSTSWaitForSecondReboot
https://learn.microsoft.com/en-us/intune/configmgr/osd/understand/task-sequence-variables#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/rogue_admin 10d ago
Why would you install software updates with a task sequence? No one does that