Skip to content
FIX: SCCM Task sequence failed with error code 0x80220005

FIX: SCCM Task sequence failed with error code 0x80220005

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

In this post, you will learn to FIX SCCM Task sequence failed with error code 0x80220005. The task sequence error prompt during operating system deployment with Configuration Manager when it’s failed to execute step added to rename the device. The error 0x80220005 Translate SCCM Error Codes to Error Messages No result in CMTrace Error lookup.

This task sequence failed with error code 0x80220005 often seen when automating the computer name by defining variables inside the task sequence, scripts, or prompting the wizard to specify the computer name to users at the time of deployment, and the computer exceeds the 15 characters limit. In case you’re auto-generating the computer name, You may experience deployment failure in the virtual machines as the serial number of the VM is too long.

Let’s learn how to display SCCM OSD Computer Name Prompt in Task Sequence Deployment. To change the computer name in the new OS, we will use the OSDComputerName variable during deployment SCCM OSD Computer Name Prompt In Task Sequence Deployment ConfigMgr

Issue Summary

This error appears at the initial stage when you have started the deployment. For example, if you’re providing a prompt to the user to enter the computer name, after providing the custom computer name with more than 15 characters in the Value text box, click OK to allow the task sequence to run.

Patch My PC
Edit Task Sequence Variable- FIX: SCCM Task sequence failed with error code 0x80220005
FIX: SCCM Task sequence failed with error code 0x80220005

Task Sequence fails with the following error message – Task Sequence: Deploy Windows 10 has failed with the error code (0x80220005). For more information, please contact your system administrator or help-desk operator.

FIX: SCCM Task sequence failed with error code 0x80220005
FIX: SCCM Task sequence failed with error code 0x80220005

In this scenario, Task Sequence terminated after the installation of the operating system. You will collect the logs at WinPE X:\Windows\temp\smstslog\smsts.log. To get the command prompt window, you have to press the F8 key and locate the location to Open the log.

 Here’s the highlight from the SMSTS.log –

Failed to open the Task Sequencing Environment. Code 0x80220005. Please ensure you are running this executable inside a properly configured OS Deployment task sequence.
Exiting with return Code Unknown error 0x80220005
Process completed with exit code 2149711877
Failed to run the action: Apply Windows Settings, Unknown error (Error: 80220005; Source: Unknown) Task sequence failed with error code 0x80220005

FIX – SCCM Task sequence failed with error code 0x80220005

Let’s check the solution to fix this task sequence error code 0x80220005

When renaming a device, the new name must be 15 characters or less. If you’re taking inputs from the user, Make sure the computer name does not exceed the characters limit. Based on the above scenario, we asked the user to appropriate the device name and perform the deployment. If you had automated with scripts, do some modification, especially if you defined the serial number and prefix.

Task Sequence Progress Bar - Deploy Windows 10 21H1 Using SCCM | ConfigMgr | Step by Step
Guide
Installation Progress – Task Sequence Deployment

Let us know your experience with the issue and steps taken to resolve it in Comment Section.

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.

Resources

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 · 4 comments

  1. Hi I am issues setting the Syntax for variable osdcomputername within the SCCM task sequence .
    My laptop test works fine but I am having issues with the syntax for VM

    For laptop I am using
    W-L-%serialnumberer%
    For the VM its w-vm-%serialnumber%

    Pls advise

    1. StaffHi, The VM serial number exceeds 15 Characters. Ensure you trimmed the serial number for using inside Virtual machines during the deployment and check your experience.

  2. How can you trim the @serialnumber% variable to only use the first or last 7 characters of the serial number? This way it stays within the 15 character limit?

  3. Hi guys, we use %SITE%-%DEVICE%-%SERIALNUMBER% and I have checked that we have the gather step before the OSDComputerName variable. The output for this particular device is 13 characters only yet we are getting the same exact error.
    The computer name output if the OSD was successful should be like this DOT-L-xxxxxxx. Here are the error logs, any advised please?

    11/07/2023 4:47 PM,47,Apply Windows Settings,Install Operating System,The task sequence execution engine failed executing an action,11135,-2,145,255,419,… ue( SetupPassValue[eSetupPass], pszComponentName, pszPath, pszValue ), HRESULT=80220005 (C:\__w\1\s\src\Framework\OSDCore\xmlanswerfile.cpp,787)
    this->SetValue( Specialize, XML::Shell::ComponentName, XML::Shell::ComputerName::Element, pszComputerName), HRESULT=80220005 (C:\__w\1\s\src\Framework\OSDCore\xmlanswerfile.cpp,903)
    m_pImpl->SetComputerNameW(pszComputerName), HRESULT=80220005 (C:\__w\1\s\src\Framework\OSDCore\xmlanswerfile.cpp,2373)
    pAnswerFile->SetComputerNameW(sValue), HRESULT=80220005(C:\__w\1\s\src\client\OsDeployment\OSDWinSettings\osdwinsettings.cpp,375)
    ConfigureWinSettings(), HRESULT=80220005 (C:\__w\1\s\src\client\OsDeployment\OSDWinSettings\osdwinsettings.cpp,707)
    Could not find CCM install folder. Don’t use ccmerrors.dll
    Exiting with return code 0x80220005
    Failed to open the Task Sequencing Environment. Code 0x80220005. Please ensure you are running this executable inside a properly configured OS Deployment task sequence.
    Unknown error (Error: 80220005; Source: Unknown)

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