This post details the steps to fix SCCM OSD task sequence error 0X80070005. The error 0X80070005 appears with the task sequence failure during the OSD Setup Windows and ConfigMgr step.
The error code 0X80070005 was initially observed on a couple of systems where the task sequence failed with 0X80070005 error.
First of all, you will need to understand the meaning of the error code 0X80070005. You can use the method to translate SCCM Error Codes To Error Messages.
You have multiple SCCM log viewer options to check different types of log files .log or .lo_ file extensions . I prefer to use CMTrace to translate the error codes.
The error 0X80070005 translates to “Access is denied.” but it is difficult to determine what’s happing here. The Error 0X80070005 is generic, and you also may encounter the same error code when the task sequence fails at some different steps.
Examining the SMSTS log for task sequence failure issues is always recommended to help you understand the failure prompt. More you can explore SCCM OSD Task Sequence Troubleshooting Steps by Step Ultimate Guide SMSTS.log.
- FIX SCCM App Deployment Errors 0x80070002 0x87d01106
- FIX: SCCM Task sequence has failed with the error code 0x80070057
- SCCM Deployment Failed to Resolve Task Sequence Dependencies 0X80040102
SCCM Task Sequence Failed with Error 0X80070005
The OSD task sequence fails with error 0X80070005 during the Setup Windows and ConfigMgr step. You could have an issue with the partitioning or could be different based on details you get inside the logs.
This issue occurs if a custom SetupComplete.cmd file is specified. OSD task sequences use the SetupComplete.cmd file to continue the task sequence after Windows Setup finishes.
If a custom SetupComplete.cmd file is specified, the task sequence can’t install its own SetupComplete.cmd file. And it returns the Access is denied error. So custom SetupComplete.cmd files aren’t allowed with Configuration Manager OSD task sequences.
A custom SetupComplete.cmd file may be specified in one of the following ways:
It’s copied to the appropriate location in a task (usually a Run Command Line task) between the Apply Operating System and Setup Windows and ConfigMgr tasks. Or It’s included as part of a custom OS WIM file.
The SetupComplete.cmd file is located in the
%WINDIR%\Setup\Scripts folder, in either the offline OS or the OS WIM image.
The first step in SCCM OSD Task Sequence troubleshooting is to check the SMSTS log to get details about the error messages or error code.
You may noticed, the following error messages are logged in the
OSDSetupWindows Installing hook to 'C:\WINDOWS' OSDSetupWindows Command line for extension .EXE is "%1" %* OSDSetupWindows Set command line: "X:\sms\bin\x64\OSDSETUPHOOK.EXE" "/install:C:\WINDOWS" /version:10.0 OSDSetupWindows Executing command line: "X:\sms\bin\x64\OSDSETUPHOOK.EXE" "/install:C:\WINDOWS" /version:10.0 OSDSetupHook Installing OSD setup hook OSDSetupHook !shCmdFile.null(), HRESULT=80070005 (..\vistasetuphook.cpp,96) OSDSetupHook Failed to install the setup hook. Permissions on the requested may be configured incorrectly. Access is denied. (Error: 80070005; Source: Windows) OSDSetupHook pHook->install(sWindowsDir), HRESULT=80070005 (..\osdsetuphook.cpp,385) OSDSetupHook Failed to install OSD setup hook (0x80070005) OSDSetupWindows Process completed with exit code 2147942405 OSDSetupWindows exitCode, HRESULT=80070005 (setupwindows.cpp,785) OSDSetupWindows Install setup hook failed with error code (80070005). OSDSetupWindows this->installSetupHook(), HRESULT=80070005 (setupwindows.cpp,452) OSDSetupWindows Failed to install setup hook (80070005) OSDSetupWindows setup.run(), HRESULT=80070005 (setupwindows.cpp,1650) OSDSetupWindows Exiting with code 0x80070005 TSManager Process completed with exit code 2147942405 TSManager Failed to run the action: Setup Windows and ConfigMgr. Permissions on the requested may be configured incorrectly. Access is denied. (Error: 80070005; Source: Windows)
Fix SCCM Task Sequence Failed with Error 0X80070005
The Error 0X80070005 is generic, and you also may encounter the same error code when the task sequence fails at different steps. The solution could be different based on the details you get into logs.
To fix this issue, remove the custom SetupComplete.cmd file from SCCM Task Sequence. In most cases, any actions taken in the custom SetupComplete.cmd file can instead be moved as tasks in the task sequence.
Depending on how the custom SetupComplete.cmd file is specified, use one of the following methods to remove the file:
- If it’s specified in a Run Command Line task between the Apply Operating System and Setup Windows and ConfigMgr tasks, remove the Run Command Line task from the task sequence.
- If it’s part of a custom OS image, add a Run Command Line task between the Apply Operating System and Setup Windows and ConfigMgr tasks. In the command line of the Run Command Line task, enter the following command to delete the custom SetupComplete.cmd file:
cmd /c del SetupComplete.cmd %OSDTargetSystemDrive%\Windows\Setup\Scripts /F /Q
Possible Scenarios –
This issue also occurs if the sccm task sequence unable to detect disk during the deployment it returns the Access is denied error. It’s important to validate the disk status and added drivers in task sequence step to check whether your organization supporting the deployment for the hardware before proceeding or looking for other possibility.
If you’re already in the error windows, the screen Task sequence has failed with the error code 0x80070490. Press F8 to launch the command prompt window or Restart the machine and boot with the same task sequence.
Important – Enable command support (F8) that is not recommended for production use. You can explore the available command prompt support option in Boot Image.
Type the command to show the disk and here you can see, In the scenrio disk status showing No Media, There Is No media in The Device. I would recommend you to take support from IT support team or you can check with device manufacturer and fix your drive issue.
About Author – Jitesh, Microsoft MVP, has over five 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 is Windows 10 Deployment solution with Configuration Manager, Microsoft Deployment Toolkit (MDT), and Microsoft Intune.