Friday, August 1, 2014

Debugging 0x8004005 error in SCCM 2012 R2 OSD deployment

I just hit a most common 0x8004005 error code with my TS (SCCM 2012 R2) on a Lenovo M92z that otherwise runs fine or iMac, MacMini and many other systems including Lenovo laptops.

Note 1: I have designed a relatively simple adapting task sequence that deploys on all makes and models in my institution.

Note 2: Unless you have a good reason to avoid it, I strongly suggest to activate command prompt support. At least in my case, it is perfect for debugging and solving all sorts of issues.

In my case, the error appeared right before Setup Windows. But this does not mean anything. In fact the error itself just means "An error occurred."

In order to resolve the issue, I have used F8 to go to command prompt as soon as the error appears on the deployed computer. 
In C:\_SMSTaskSequence\Logs\smsts.log , you will probably find nothing useful but still you need to check it. Open it using the following command (assuming you are in the right directory): notepad smsts.log .
As a second step, in the X:\Windows\panther\setupact.log we will find what we are looking for... or maybe not??? Depending on the failure, the log file may be located in the following places (check them all even if you found a log file somewhere else!!!):
  • C:\_SMSTaskSequence\Logs\smsts.log
  • X:\Windows\panther\setupact.log
  • X:\Windows\Temp\SMSTSLog\smsts.log
Note 3: If 15 minutes have gone and the SCMM client has completely erased C:\_SMSTaskSequence look in C:\ and in sub-folders for the setupact.log.  

Note 4: If Windows installs but some settings do not get applied use the above mentioned setupact.log with setuperr.log, both in C:\Windows\panther\, to check for errors.


The error reads: Windows Setup could not install one or more boot-critical drivers. To install Windows, make sure that the drivers are valid, and restart the installation.
In this case: the error indicates that Windows failed to import a boot critical driver. On the previous line, the log identifies the driver that was last imported: btmleihd.inf. But what is it and how to find it?
In SCCM --> Drivers, search for a driver with criteria INF file:

It is an Intel Bluetooth driver that windows, for some reason, has considered critical and applicable to this specific system. This driver needs to be disabled or deleted or ... anything you want as long as it does not get installed on the given machine.


If the error occurs before the task sequence starts, check the time on the computer and make sure that there is at least one TS available for that machine. It is possible that the time of the computer is set to let's say 2005 (faulty battery or BIOS/UEFI reset) and all TS are available from 2014. Similarly, the computer may be classified in the wrong category and has no TS associated with it. 


It is possible that the deployment failed for another reason. For example:
  • could not set boot record
  • could not find boot partition
  • etc.