SCCM Error 0x4005(16389)

This SCCM error 0x4005(16389) is thrown when task sequence execution fails.

I was deploying the 22H2 upgrade and this error was thrown on a device.

Looked further in SMSTS.log and found the task sequence failed at the following:

The execution of the group (Prompt before Upgrade) has failed and the execution has been aborted. An action failed. Error 0x80004004	TSManager	26/03/2024 4:00:16 PM	1300 (0x0514)

Failed to run the last action: Upgrade Prompt with Defer option. Result 60012. Execution of task sequence failed.	TSManager	26/03/2024 4:00:16 PM	1300 (0x0514)

Showing task sequence error message after failure in task sequence step of type 'SMS_TaskSequence_RunCommandLineAction'	TSManager	26/03/2024 4:00:16 PM	1300 (0x0514)

Active power scheme is cbd2463e-9cea-42a7-bdff-7c02f06b18c2	TSManager	26/03/2024 4:00:17 PM	1300 (0x0514)

Reverting power plan to the initial setting after it was set to custom performance plan.	TSManager	26/03/2024 4:00:17 PM	1300 (0x0514)
Set active power scheme to db310065-829b-4671-9647-2261c00e86ef	TSManager	26/03/2024 4:00:17 PM	1300 (0x0514)

Deleted power scheme cbd2463E-9cea-42a7-bdff-7c02f06b18c2	TSManager	26/03/2024 4:00:17 PM	1300 (0x0514)

Task Sequence Engine failed! Code: enExecutionFail	TSManager	26/03/2024 4:00:17 PM	1300 (0x0514)

****************************************************************************	TSManager	26/03/2024 4:00:17 PM	1300 (0x0514)
Task sequence execution failed with error code 80004005	TSManager	26/03/2024 4:00:17 PM	1300 (0x0514)

Cleaning Up.	TSManager	26/03/2024 4:00:17 PM	1300 (0x0514)
Removing Authenticator	TSManager	26/03/2024 4:00:17 PM	1300 (0x0514)

Cleaning up task sequence folder	TSManager	26/03/2024 4:00:17 PM	1300 (0x0514)

Unable to delete file \\?\C:\_SMSTaskSequence\TSEnv.dat (0x80070005). Continuing.	TSManager	26/03/2024 4:00:17 PM	1300 (0x0514)

Failed to delete directory 'C:\_SMSTaskSequence'	TSManager	26/03/2024 4:00:17 PM	1300 (0x0514)

SetNamedSecurityInfo() failed.	TSManager	26/03/2024 4:00:17 PM	1300 (0x0514)

SetObjectOwner() failed. 0x80070005.	TSManager	26/03/2024 4:00:17 PM	1300 (0x0514)

RemoveFile() failed for C:\_SMSTaskSequence\TSEnv.dat. 0x80070005.	TSManager	26/03/2024 4:00:17 PM	1300 (0x0514)

RemoveDirectoryW failed (0x80070091) for C:\_SMSTaskSequence	TSManager	26/03/2024 4:00:17 PM	1300 (0x0514)

Deleting volume ID file C:\_SMSTSVolumeID.7159644d-f741-45d5-ab29-0ad8aa4771ca ...	TSManager	26/03/2024 4:00:17 PM	1300 (0x0514)

In my case, the task sequence was unable to download a package earlier, found this in additional logging we created as part of sequence execution.

SCCM Error 80072f0c was thrown.

Found that the device was not on-prem, it was downloading pre-cached package, it missed downloading a few files, that impacted the sequence execution.

Deleted the custom registries created as part of sequence execution and re-ran advertisement to deploy the upgrade.

Leave a Reply

Your email address will not be published. Required fields are marked *