Windows 10 Sysprep problems

robtheplod
robtheplod used Ask the Experts™
on
Hi

I need to to build around 40 new windows 10 pro PCs. I have carried this out with older versions of windows with no issues.

I have prepared my PC and installed the relevant software that is needed by the end users. I am at the stage where I need to sysprep the PC but I am facing issues. When carrying out sysprep is receive the following error -

sysprep-fail.jpg
From other research, I have found that this is relating to installed apps. I have been through and uninstalled these apps but i still receive the error. The logs are looking like the attached file.

Has anyone had these issues before? I need some advice on this and how to get around this issue?

Thank you.
Sysprep-Log.txt
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Tahir QureshiSystem Analyst

Commented:
Is it a clean installation or upgrade installation


as per I know Sysprep is not supposed to work on an upgraded system and thus the warning blocking sysprep from running.


Try this (My friend told me it work for him)


HKEY_LOCAL_MACHINE\system\setup

There was a key called “upgrade”, that once deleted lets you run SysPrep like normal.
Delete that key and you are good.
Set HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus to 7
Run sysprep again as Admin, It's finally work for him
Tahir QureshiSystem Analyst

Commented:
I think I got your issue now




SYSPRP Package Microsoft.Messaging_3.19.1001.0_x86__8wekyb3d8bbwe was installed for a user, but not provisioned for all users. This package will not function properly in the sysprep image.

Capture.JPG
robtheplodTechnical Manager

Author

Commented:
Hi,

We have tried to remove the metro apps and delete the user in question, however the same error still occurs.

The user (SID 1184) has been deleted correctly but still shows up as having provisioned apps (microsoft messaging)
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Tahir QureshiSystem Analyst

Commented:
the registry still exist

SYSPRP Failed to remove apps for the current user: 0x80073cf2.


try delete the registry
Tahir QureshiSystem Analyst

Commented:
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 Windows 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.
robtheplodTechnical Manager

Author

Commented:
We've tried this, however it still lists packages installed for users for user profiles that do not exist. I can't find a way to remove these apps for all profiles.
Tahir QureshiSystem Analyst

Commented:
It seems that during updates or possibly VMWARE software creates unknown user profiles on windows. Delete these profiles and sysprep will run.

Run the Import-Module Appx PowerShell cmdlet.
Run Import-Module Dism.
Run Get-AppxPackage -AllUser | Where PublisherId -eq 8wekyb3d8bbwe | Format-List -Property PackageFullName,PackageUserInformation.

Get-AppxPackage -AllUser | Format-List -Property PackageFullName,PackageUserInformation
Last command is one that will show if app is on another account.
Tahir QureshiSystem Analyst

Commented:
can you please share the last command result
robtheplodTechnical Manager

Author

Commented:
Tahir QureshiSystem Analyst

Commented:
I have wrote a small script

Please go through and adjust the script to uninstall the application

Note To prevent Windows Store from updating apps, unplug the Internet connection or disable Automatic Updates in Audit mode before you create the image.


Import-Module AppX
Import-Module Dism
 
#You may have to manually uninstall some Sponsored Apps from the Start Menu
 
#Remove AppX Packages for non-business Apps
Get-AppxPackage *Microsoft.3DBuilder* | Remove-AppxPackage
Get-AppxPackage *Microsoft.Getstarted* | Remove-AppxPackage
Get-AppxPackage *Microsoft.Messaging* | Remove-AppxPackage
Get-AppxPackage *Microsoft.MicrosoftOfficeHub* | Remove-AppxPackage
Get-AppxPackage *Microsoft.MicrosoftSolitaireCollection* | Remove-AppxPackage
Get-AppxPackage *Microsoft.Office.OneNote* | Remove-AppxPackage
Get-AppxPackage *Microsoft.People* | Remove-AppxPackage
Get-AppxPackage *Microsoft.SkypeApp* | Remove-AppxPackage
Get-AppxPackage *microsoft.windowscommunicationsapps* | Remove-AppxPackage
Get-AppxPackage *Microsoft.WindowsFeedbackHub* | Remove-AppxPackage
Get-AppxPackage *Microsoft.XboxApp* | Remove-AppxPackage
Get-AppxPackage *Microsoft.XboxIdentityProvider* | Remove-AppxPackage
Get-AppxPackage *Microsoft.ZuneMusic* | Remove-AppxPackage
Get-AppxPackage *Microsoft.ZuneVideo* | Remove-AppxPackage
 
#Remove AppX Provisioning for non-business apps
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.3DBuilder" | Remove-AppxProvisionedPackage -Online
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.Getstarted" | Remove-AppxProvisionedPackage -Online
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.Messaging" | Remove-AppxProvisionedPackage -Online
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.MicrosoftOfficeHub" | Remove-AppxProvisionedPackage -Online
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.MicrosoftSolitaireCollection" | Remove-AppxProvisionedPackage -Online
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.Office.OneNote" | Remove-AppxProvisionedPackage -Online
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.People" | Remove-AppxProvisionedPackage -Online
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.SkypeApp" | Remove-AppxProvisionedPackage -Online
Get-AppxProvisionedPackage -Online | where Displayname -EQ "microsoft.windowscommunicationsapps" | Remove-AppxProvisionedPackage -Online
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.WindowsFeedbackHub" | Remove-AppxProvisionedPackage -Online
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.XboxApp" | Remove-AppxProvisionedPackage -Online
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.XboxIdentityProvider" | Remove-AppxProvisionedPackage -Online
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.ZuneMusic" | Remove-AppxProvisionedPackage -Online
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.ZuneVideo" | Remove-AppxProvisionedPackage -Online

Open in new window

Tahir QureshiSystem Analyst

Commented:
There may be some other apps  but These one I know

If you are getting simillar error (use a wild card * with Package name) and than remove

Get-AppxPackage | ? PackageFullName -like *PackageName*
Tahir QureshiSystem Analyst

Commented:
I have found similar issue which has resolve here

https://gist.github.com/ponsfrilus/1d1c3ee5632ce6f05210c754c4d27830
Commented:
One question, Is this a fresh install or upgrade?
If this is fresh install, do not worry about the applications, you can remove for the ISO before installing.
Here is my article on how to achieve this
https://www.experts-exchange.com/articles/29379/Uninstall-applications-from-Windows-10-ISO-version-1607.html

Also what are you using for capture the image?
Is this physical machine or virtual machine?
Is the machine connected to domain?
robtheplodTechnical Manager

Author

Commented:
Thanks for your help everyone, we decided to image as is in the end as the sysprep refused to work.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial