Image Capture Wizard Fails With Error Code (0x00004005)

This is a solution to resolved image capture error from SCCM while capturing standard image. I was able to successfully resolved error code while I was trying to capture Win 10 latest update image. Basically issues caused my APPX package on Windows store. Only solution is to get rid appx associated profile, so SCCM wouldn’t have to do some extra work which bound to fail :). My case my image was on VM which allowed me to take lots of snapshots which saved me tones of time. Hope this will help some of you.

All the credits goes to here. I had to do some changes in my process while I was doing this.

1.  Run the Powershell command  ‘Get-AppxPackage | Remove-AppxPackage’

2. Configure your registry settings for SysPrep.

  1. Open regedit and look for:
  2. HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus\CleanupState\ 
    Set to value: 2 ( My case this wasn’t there)
  3. HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus\GeneralizationState\ 
    Set to value: 7 ( This was already set to 7)
  4. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\SoftwareProtectionPlatform\SkipRearm 
    Set to value: 
  5. Then, run the command:msdtc -uninstall (wait a few seconds) 
    msdtc -install (wait a few seconds) ( My case I didn’t see anything happened but who knows ran it anyways)

3.  Next Steps to resolve appx,

  1. Run the Import-Module Appx PowerShell cmdlet
  2. Run Import-Module Dism
  3. Run Get-AppxPackage -AllUser | Where PublisherId -eq 8wekyb3d8bbwe | Format-List -Property PackageFullName,PackageUserInformation
  4. Run Get-AppxPackage -AllUser | Where PublisherId -eq 8wekyb3d8bbwe | Remove-AppXPackage
  5. On my VM I saw all my two accounts had the appx, so I created another local admin account and log in with that new account.
  6. After with the new account I have delete whatever account is tied to all of my Appx packages.
  7. Reboot the computer and login to your new admin account.
  8. Capture the image as your new admin account.

Also here is the place to see the error on capture process.

C:\Windows\System32\Sysprep\Panther

following files has the issues related to capture.

  • setupact.log
  • setuperr.log