Sysprep Failing again with Win10 2004 Multi User with Office 365 apps

Highlighted
Occasional Visitor

Previously, I had issues with sysprep'ing the Win 10 2004 multi user with 365 apps. That was resolved by removing the input and cortana appx packages before sysprep'ing. 

 

Now however, I am getting these sysprep errors with the latest build from the market place.

 

From the setupact.txt file:

2020-08-20 14:31:44, Info [0x0f008b] SYSPRP RunRegistryDlls:Found entrypoint in registry at SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\SysPrepExternal\Cleanup\D7ED1F19-E2ED-11EA-8AF9-000D3A054424; will try to launch 'DscCore.dll,SysPrep_Cleanup'
2020-08-20 14:31:44, Info [0x0f0080] SYSPRP LaunchDll:Found 'DscCore.dll,SysPrep_Cleanup'; executing it
2020-08-20 14:31:44, Error [0x0f0082] SYSPRP LaunchDll:Failure occurred while executing 'DscCore.dll,SysPrep_Cleanup', returned error code 0x2
2020-08-20 14:31:44, Error [0x0f0070] SYSPRP RunDlls:An error occurred while running registry sysprep DLLs, halting sysprep execution. dwRet = 0x2[gle=0x00000006]
2020-08-20 14:31:44, Error [0x0f00ae] SYSPRP WinMain:Hit failure while processing sysprep cleanup external providers; hr = 0x80070002[gle=0x00000006]

 

This if from the setuperr.txt file:

2020-08-20 14:31:44, Error [0x0f0082] SYSPRP LaunchDll:Failure occurred while executing 'DscCore.dll,SysPrep_Cleanup', returned error code 0x2
2020-08-20 14:31:44, Error [0x0f0070] SYSPRP RunDlls:An error occurred while running registry sysprep DLLs, halting sysprep execution. dwRet = 0x2[gle=0x00000006]
2020-08-20 14:31:44, Error [0x0f00ae] SYSPRP WinMain:Hit failure while processing sysprep cleanup external providers; hr = 0x80070002[gle=0x00000006]

 

Any ideas on how to go about resolving this. So a simple image can deployed to WVD?

 

 

1 Reply
Highlighted
To resolve this issue, remove the package for the user who's running sysprep, and also remove the provisioning. To do this, follow these steps.

Note To prevent Microsoft Store from updating apps, unplug the Internet connection or disable Automatic Updates in Audit mode before you create the image.
Run the Import-Module Appx PowerShell cmdlet.
Run Import-Module Dism.
Run Get-AppxPackage -AllUser | Where PublisherId -eq 8wekyb3d8bbwe | Format-List -Property PackageFullName,PackageUserInformation.

Notes
In the output of this last cmdlet, check the users for whom the package is showing up as Installed. Delete these user accounts from the reference computer, or log on to the computer by using these user accounts. Then, run the cmdlet in step 4 to remove the Appx package.
This command lists all packages that were published by Microsoft and installed by any user of that reference computer. Because the computer is to be sysprepped, we assume that these user profiles no longer require the package.
If you have manually provisioned apps that belong to other publishers, run the following command to list them:

Get-AppxPackage -AllUser | Format-List -Property PackageFullName,PackageUserInformation
Run Remove-AppxPackage -Package <packagefullname>.
Remove the provisioning by running the following cmdlet:

Remove-AppxProvisionedPackage -Online -PackageName <packagefullname>
If you try to recover from an update issue, you can reprovision the app after you follow these steps.

Note The issue does not occur if you are servicing an offline image. In that scenario, the provisioning is automatically cleared for all users. This includes the user who runs the command.