Many organizations use serial numbers as the naming convention for devices in SCCM.
For most devices, this is not an issue, but if you are using this for virtual machines, you may run into some issues.
This is because there is a limit for how long computer names can be in SCCM.
I noticed this issue at a customer where they were deploying machines using SCCM and automatically configuring the machine name according to the serial number.
What is the 0x8022005 error code in SCCM?
Machine installations using SCCM might fail during the Apply Windows Settings step with the following error code:
Failed to open the Task Sequencing Environment. Code 0x80220005. Please ensure you are running this executable inside a properly configured OS
In my specific scenario, the customer used virtual machines and automatically generated names based on the serial number.
The reason why you may see this error is that SCCM does not support computer names longer than 16 characters.
How to fix the 0x8022005 error code
If you have a script that sets the serial number automatically, you will need to configure it to only take the first 16 characters of the serial number. This will fix the 0x8022005 error code.
Keep in mind that there is a limit to how long names can be in SCCM. In most cases, you should be fine :).