question

JoeDry-3226 avatar image
1 Vote"
JoeDry-3226 asked freeAppz-0153 commented

Sysprep Fails on 20H2

Bit of help on Sysprep needed. I'm trying to capture a master image from Hyper-V (Windows 10 Pro 20H2) and I'm having issues to do with the windows store apps.

I have run:
Get-AppxPackage -AllUsers | Remove-AppxPackage
and
Get-AppxProvisionedPackage -online | Remove-AppxProvisionedPackage -online

and I still get this in the logs:2021-01-16 15:47:06, Error SYSPRP Package Microsoft.549981C3F5F10_1.1911.21713.0_x64__8wekyb3d8bbwe was installed for a user, but not provisioned for all users. This package will not function properly in the sysprep image.
2021-01-16 15:47:06, Error SYSPRP Failed to remove apps for the current user: 0x80073cf2.
2021-01-16 15:47:06, Error SYSPRP Exit code of RemoveAllApps thread was 0x3cf2.
2021-01-16 15:47:06, Error SYSPRP ActionPlatform::LaunchModule: Failure occurred while executing 'SysprepGeneralizeValidate' from C:\Windows\System32\AppxSysprep.dll; dwRet = 0x3cf2
2021-01-16 15:47:06, Error SYSPRP SysprepSession::Validate: Error in validating actions from C:\Windows\System32\Sysprep\ActionFiles\Generalize.xml; dwRet = 0x3cf2
2021-01-16 15:47:06, Error SYSPRP RunPlatformActions:Failed while validating Sysprep session actions; dwRet = 0x3cf2
2021-01-16 15:47:06, Error [0x0f0070] SYSPRP RunDlls:An error occurred while running registry sysprep DLLs, halting sysprep execution. dwRet = 0x3cf2
2021-01-16 15:47:06, Error [0x0f00d8] SYSPRP WinMain:Hit failure while pre-validate sysprep generalize internal providers; hr = 0x80073cf2

I cannot uninstall this package individually either, help would be much appreciated.

Joe

windows-10-generalwindows-10-setup
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

You know what gets me most about this? This has been an issue since the VERY FIRST Windows 10 version. And those *** at Microsoft STILL haven't fixed it. And they STILL want you to run through a load of commands to remove apps. If it's as simple as running a command then why is that not already coded in to SysPrep??

The worst part is that once you get one app sorted it then tells you about another one. The only way I ever found to do it was to create your local user, enable the admin account, swap accounts and remove the local users without it having been on the internet. The second it connects to the internet you get this crap. Microsoft leaving this unfixed is unforgivable.

0 Votes 0 ·
TylerFleming-9422 avatar image
2 Votes"
TylerFleming-9422 answered freeAppz-0153 commented

I am running into this issue as well, where the resolution steps found in this article (https://docs.microsoft.com/en-us/troubleshoot/windows-client/deployment/sysprep-fails-remove-or-update-store-apps) do not solve the issue.

Edit: Solution (for now), copied from my comment below.

I have been able to successfully get sysprep to work BUT it required that I never open the start menu. Win + X and Powershell are your friend. The issue is specifically opening the Windows Start menu because that kicks off all the Windows Store/Appx Updates on the machine. You CAN use file explorer and what not. I have a theory that you could probably also use the Cortana Search (by click the Magnifying Glass icon and NOT the start menu) as well; but haven't tested that yet.

· 9
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Quick Update here: I have been able to successfully get sysprep to work BUT it required that I never open the start menu. Win + X and Powershell are your friend. The issue is specifically opening the Windows Start menu because that kicks off all the Windows Store/Appx Updates on the machine. You CAN use file explorer and what not. I have a theory that you could probably also use the Cortana Search (by click the Magnifying Glass icon and NOT the start menu) as well; but haven't tested that yet.

2 Votes 2 ·

Thank you! This works for me too. Can finally get everything on 20H2 now, thanks again. Microsoft really should fix this!

0 Votes 0 ·

Glad you were able to get it working! I'm glad I wasn't the only one experiencing this issue.

0 Votes 0 ·
Show more comments

Awesome, I have shared your post into r/MDT too for any of the MDT guys like myself that might have been facing this issue.

0 Votes 0 ·

I did the Win + X and it brought up a PS screen, but with no command line...Open, New, Save.... I'm not sure how to use that PS.

0 Votes 0 ·

Thank you for the solution, worked like a charm.
Very frustrating though...

0 Votes 0 ·

Great solution, worked perfect!
Keep up the good work. :-)

0 Votes 0 ·
jiteshkumar-1983 avatar image
0 Votes"
jiteshkumar-1983 answered JoeDry-3226 commented

Hello, It generally occurs when the Store Apps (Appx package) is installed for a particular user account and is not available for other users.

How you performing the capture manually or Task Sequence? Make sure to use one account to avoid such issue.

Explore this guide - https://www.anoopcnair.com/sysprep-capture-windows-10-image-using-dism/

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The image is being captured from the built-in Administrator account. I have tried using this and created another user account to attempt to fix the issue. The package (after some googling) appears to be something related to Cortana. The capture is being done by running sysprep manually and then using WDS capture. Sysprep immediately throws the "unable to validate windows installation" error as soon as the generalise process is started. Is there any way to FORCE remove this package using the powershell, as I can't remove the affected package.

0 Votes 0 ·
Sean-Liming avatar image
0 Votes"
Sean-Liming answered

If the package/application is not needed, uninstall the package and sysprep should run.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AliceYang-MSFT avatar image
0 Votes"
AliceYang-MSFT answered JoeDry-3226 commented

Hi,

The issue you are facing is a known issue. Please follow the resolution in Sysprep fails after you remove or update Microsoft Store apps that include built-in Windows images to troubleshoot.

I have run:
Get-AppxPackage -AllUsers | Remove-AppxPackage
and
Get-AppxProvisionedPackage -online | Remove-AppxProvisionedPackage -online

It seems that you have tried some troubleshooting. Please try the resolution step by step. If the resolution still doesn't work, perhaps you need to uninstall the packages before sysprep is run.


If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

57613-screenshot-2021-01-18-at-113102.png



I can't remove the package. It fails with this error, and I'm now completely stuck. I don't want any 'Windows Store' apps in the image at all, I would simply like to force remove this affected package.

0 Votes 0 ·
AliceYang-MSFT avatar image
0 Votes"
AliceYang-MSFT answered

Hi,

Installing new Microsoft Store apps or updating your existing Microsoft Store apps before generalizing a Windows image will cause Sysprep to fail. Sysprep /generalize requires that all apps are provisioned for all users; however, when you update an app from the Microsoft Store, that app becomes tied to the logged in user account.
The following error appears in the Sysprep log files (located at %WINDIR%\System32\Sysprep\Panther):
<package name> was installed for a user, but not provisioned for all users. This package will not function properly in the sysprep image.

So I think uninstalling Microsoft Store apps or the updates before you run Sysprep is a must. The apps might be updated automatically or new apps were installed on the PC.

After you uninstall the apps or the updates, if the issue persists, please let us know and we will continue to help you with the issue.


If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RS4KING-4083 avatar image
0 Votes"
RS4KING-4083 answered RS4KING-7460 commented

I came across these errors in my log, so I decided to run the powershell command to remove the Packages. I did the first one, cleared the log (for easier reading), ran the sysprep and got another error for another Appx Package. I did the PS command to remove that package, cleared the log, ran the sysprep again etc. I had to keep doing this for like 15 different apps.

Finally the sysprep did its thing and restarted, just when I thought it was going to work, it loaded back into Windows and my start menu was all jacked up. It kept telling me "Critical Error - your start menu suffered a critical error" any time I tried to click on Start. I tried to reinstall shellexperience via PS and nothing worked, so I ended up just reinstalling a fresh copy of Windows 10 again and came back to the drawing board.

I'm going to try what TylerFleming suggested and not click the start menu at all. After the fresh install of Windows, I'm going to use alt-x and kick off windows updates via command prompt. If I can at least capture an Image with the latest updates and no programs, I would call it a win. Thanks for your suggestions.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

After doing the sysprep with not clicking start at all, it fixed everything for me!

Good luck.
Joe

0 Votes 0 ·

It didn't for me. I literally didn't click start or push the button on the keyboard once. Used Window Key + R, Window Key + I (for settings/updates) and I updated all the way and I still get an error in the sysprep log stating some issue with AppxPackage being installed for a user but not provisioned for all.

I did a RemoveAppxPackage powershell command, ran it again, and now I get it for WavesAudo.Waves blah blah. So basically I was able to remove that one package but now it's another one, and it will continue to do that till I eventually break my start menu again and have to start from the beginning.

Very frustrating.

0 Votes 0 ·
LuisVitalAlmeida-2238 avatar image
0 Votes"
LuisVitalAlmeida-2238 answered
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.