Skip to content
FIX: SCCM TS environment is not initialized Error 0x80007002

FIX: SCCM TS environment is not initialized Error 0x80007002

Written By Jitesh Kumar
Last Updated September 17, 2021
Posted In SCCM
SHARE

Let’s see how you can FIX SCCM TS environment is not initialized Error 0x80007002. You might encounter a prompt message an error task sequence has failed to run this step for this computer during Operating System Deployment with SCCM Task Sequence. The Task Sequence Error 0x80007002 is generic, and the solution could be different based on the details you get into logs.

Generally, The error code 0X80070002 Translates SCCM Error Codes to Error “The system cannot find the file specified”. This is often seen when the specified command run in the task sequence step doesn’t execute the command, or the DP can’t be reached.

You can also check the possible solution to resolve SCCM Task Sequence Error 0x80004005 Failed to Run, SCCM Task Sequence Failed With Error Code 0x80070002.

Issue Summary

This error appears at the apply driver task sequence step when you have started the deployment in the client machine with the deployment task sequence via PXE Boot. Task Sequence failed error message –

Patch My PC

In this scenario, Task Sequence terminated after applying the operating system phase. You will collect the logs at WinPE C:\_SMSTaskSequence\Logs\Smstslog\smsts.log. To get the command prompt window, you have to press F8 key. More you can explore SCCM OSD Task Sequence Troubleshooting Steps by Step Ultimate Guide SMSTS.log. Here’s the highlight from the SMSTS.log –

SMSTS log - SCCM TS environment is not initialized Error 0x80007002
SMSTS log – SCCM TS environment is not initialized Error 0x80007002
Activating Finish Page.	TSMBootstrap	09-09-2021 16:15:03	1584 (0x0630)
Exiting task sequence wizard.	TSMBootstrap	09-09-2021 16:15:07	1584 (0x0630)
Exiting with return code 0x00000000	TSMBootstrap	09-09-2021 16:15:07	1584 (0x0630)
Execution complete.	TSBootShell	09-09-2021 16:15:07	1072 (0x0430)
hMap != 0, HRESULT=80070002 (..\environmentscope.cpp,493)	TSBootShell	09-09-2021 16:15:07	1072 (0x0430)
m_pGlobalScope->open(), HRESULT=80070002 (..\environmentlib.cpp,335)	TSBootShell	09-09-2021 16:15:07	1072 (0x0430)
this->open(), HRESULT=80070002 (..\environmentlib.cpp,561)	TSBootShell	09-09-2021 16:15:07	1072 (0x0430)
::RegOpenKeyExW (HKEY_LOCAL_MACHINE, sKey.c_str(), 0, KEY_READ, &hSubKey), HRESULT=80070002 (..\utils.cpp,1107)	TSBootShell	09-09-2021 16:15:07	1072 (0x0430)
RegOpenKeyExW is unsuccessful for Software\Microsoft\SMS\Task Sequence	TSBootShell	09-09-2021 16:15:07	1072 (0x0430)
GetTsRegValue() is unsuccessful. 0x80070002.	TSBootShell	09-09-2021 16:15:07	1072 (0x0430)
End program: 	TSBootShell	09-09-2021 16:15:07	1072 (0x0430)
Finalizing logging from process 1048	TSBootShell	09-09-2021 16:15:07	1072 (0x0430)
Finalizing logs to root of first available drive	TSBootShell	09-09-2021 16:15:07	1072 (0x0430)
Successfully finalized logs to C:\SMSTSLog	TSBootShell	09-09-2021 16:15:07	1072 (0x0430) TS environment is not initialized
Cleaning up task sequencing logging configuration.	TSBootShell	09-09-2021 16:15:07	1072 (0x0430)
TS::Environment::SharedEnvironment.isInitialized() == true, HRESULT=80004005 (..\tslogging.cpp,694)	TSBootShell	09-09-2021 16:15:07	1072 (0x0430)
TS environment is not initialized	TSBootShell	09-09-2021 16:15:07	1072 (0x0430)

FIX – SCCM TS environment is not initialized Error 0x80007002

Let’s check the possible solution to fix the SCCM TS environment is not initialized Error 0x80007002. Since the deployment task sequence was using the auto-apply task sequence step for some onboarded models in SCCM.

The Auto Apply steps scan the hardware, find the plug-and-play IDs for all devices present on the system, and send them to the management point returns a list of compatible drivers from the driver catalog for each hardware device. For each hardware device, the task sequence picks the best driver. 

Here the task sequence was falling to find compatible drivers from the scan. We had excluded the deployed model with WMI query from the auto apply task sequence step and reinitiated the deployment. It worked successfully for us without an issue.

For Example, Select Add a condition > Query WMI from the drop-down menu to create a query not to target this step to the model. You can check more detailed steps to add a WMI query.

Auto Apply Drivers Task Sequence Step - SCCM TS environment is not initialized Error 0x80007002
Auto Apply Drivers Task Sequence Step – SCCM TS environment is not initialized Error 0x80007002

Use the HTMD Forum, the one-stop shop for all your device management queries related to ConfigMgr (a.k.a SCCM), Intune, and more!

Resources

Author

About Author -> Jitesh has over 5 years of working experience in the IT Industry. He writes and shares his experiences related to Microsoft device management technologies and IT Infrastructure management. His primary focus area is Windows 10 Deployment solution with Configuration Manager, Microsoft Deployment Toolkit (MDT), and Microsoft Intune.

Written by

Jitesh has over 5 years of working experience in the IT Industry. He writes and shares his experiences related to Microsoft device management technologies and IT Infrastructure management. His primary focus area is Windows 10 Deployment solution with Configuration Manager, Microsoft Deployment Toolkit (MDT), and Microsoft Intune.

Discussion

Join the discussion

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

Related guides

Intune

Windows 11 KB5101650 KB5099414 July 2026 Patch and 3 Zero Day Vulnerabilities and 570 Flaws

Key Takeaways Windows 11 KB5101650 KB5099414 July 2026 Patch and 3 Zero Day Vulnerabilities and 570 Flaws! In the July 2026 Patch, Microsoft introduced new features designed to improve the overall Windows experience. The update adds enhancements to Windows Update for more flexible update management and introduces Point-in-Time Restore, providing an additional recovery option for […]

AC Anoop C Nair 9 min read
Intune

2026 June KB5094126 KB5093998 Windows 11 Patch | 3 Zero Day Vulnerabilities and 200 Flaws

Key Takeaways 2026 June KB5094126 KB5093998 Windows 11 Patch | 3 Zero Day Vulnerabilities and 200 Flaws! The June 2026 Windows 11 Patch Tuesday update brings several improvements to File Explorer. It adds support for additional archive formats, including UU, CPIO, XAR, and NuGet Packages (NUPKG). The update also preserves View and Sort preferences in […]

AC Anoop C Nair 10 min read
Intune

2026 May KB5089549 KB5087420 Windows 11 Patch | 0 Zero Day Vulnerabilities and 120 Flaws

Key Takeaways The Windows 11 May 2026 Patch KB5089549 KB5087420 Update brings important security fixes, performance improvements, and reliability enhancements across the operating system. The update introduces new features such as Xbox Mode for gaming, File Explorer improvements, enhanced input and sharing experiences, better taskbar and Windows Hello reliability, and additional enterprise management capabilities for […]

AC Anoop C Nair 8 min read
SCCM

ConfigMgr 2603 Introduces New Early Update Enrollment Process

Key Takeaways In this post we are discussing the ConfigMgr 2603 Introduces New Early Update Enrollment Process. Microsoft has officially released Configuration Manager version 2603 to the Early Update Ring, giving organizations an opportunity to test upcoming improvements before the global production rollout. The release is targeted at enterprises running ConfigMgr version 2409 or later […]

AC Anoop C Nair 3 min read