Hey welcome to my blog and Happy 2018! Some of you may remember I did an article last year about
AppX
apps and how they can break
Sysprep
. I explained how I ran into the issue and then I went a little further than that and provided a couple scripts to help remove the
AppX packages
and to remove
provisioning
of those apps so they don’t install under other accounts. Surprisingly it’s one of the more popular articles on here.
During my day job I’m constantly working with images for VDI deployments and I’m finding additional apps to remove and new ways to view and sort through them all. I wanted to detail those as an addition to my
previous article
. I also wanted to talk through how most people end up breaking
Sysprep
and how to avoid doing so altogether.
How not to break Sysprep
Ok so this is a LOT easier than you may think. There’s 3 rules to follow and if you follow them you should not have issues with AppX and Sysprep.
DO NOT log on more than one account after installing Windows 10
. The first time you boot up after installing Windows 10 it asks you to create a new account. I usually call it “temp” or something like that since it’s intentionally temporary. When building an image you usually don’t want to have the “temp” account as the one you use going forward. You may have even joined the image to the domain and logged on under multiple accounts or even enabled and logged on as the local administrator. This is the first and most common mistake. Once you login to other accounts the AppX apps will be installed under the additional user accounts/profiles and has greater potential to cause Sysprep to fail. AppX apps are provisioned or downloaded on every account you login to. You can login to multiple accounts but you have to follow the next 2 rules.
If you do logon under other accounts, run the AppX removal scripts under ALL accounts removing the SAME apps from all accounts.
You must run the AppX Removal scripts on every account you logged into on the image. You must also ensure that you remove exactly the same AppX apps and do not install any additional AppX apps on any of the logged in accounts.
DO NOT delete accounts or profiles from the image until you’ve run the AppX removal scripts.
If you delete an account/profile that has an AppX app deployed it can effectively get stuck. You may run into a situation where you cannot remove the AppX app because it’s stuck in the database as deployed to an account that no longer exists.
If you follow the above rules you can easily avoid problems with
AppX apps
and
Sysprep
. You have to remember that if the image is network connected then the
Windows Store
can download and install
Sponsored Apps
for every account you login to. If you remove those apps on one account that doesn’t mean those apps are removed from any other accounts you may have logged into. This is also true for the base AppX apps that get installed natively like Bing News and others. If you
Remove-Package
a native Microsoft AppX app but you have logged into another account then you also have to Remove-Package that app on any other accounts you’ve logged into.
For my testing and validation of the following scripts I built a
Windows 10 – 1703
and a
Windows 10 – 1709
virtual machine in my
vSphere 6.5
lab. They’re both completely vanilla. I installed Windows 10, installed VMware Tools, downloaded and applied updates from WindowsUpdate and took a snapshot of each so I could break and unbreak them very quickly. As mentioned previously, Windows 10 forces you to create a user account on first boot after install so I created a “Temp” account. The local administrator account is disabled by default. I left them both network connected and did not join a domain.
Which AppX apps are installed for which accounts?
The first thing we need to do is check which AppX apps we have installed and under what accounts. You will need to set the Execution Policy in Powershell to allow you to run the script first. So open an elevated
Powershell
or an elevated
Powershell ISE
window and run the following command to allow scripts to run.
Set-ExecutionPolicy Unrestricted
And after you have finished running the removal scripts on all necessary accounts you should set it back using the below command.
Set-ExecutionPolicy Restricted
The script below will output the
Get-AppXPackage
command to a text file at the root of the C Drive.
#VirtuallyInclined.com 2018
#You may have to manually uninstall some Sponsored Apps from the Start Menu.
#This has been tested on Windows 10 Enterprise 1703 and 1709.
#This script will output the AppX Packages installed and user accounts they're installed to
#Check c:\appx.txt for the list of installed AppX packages.
Import-Module AppX
Import-Module Dism
Get-AppxPackage -AllUser | FL -Property PackageFullName,PackageUserInformation > c:\appx.txt
At the root of the C Drive you should find a text file containing the output which should look something like the below snippet.
You’ll notice this one lists only one “User” account because in this case that’s all I’ve logged in with. If you’ve logged into the image with more than one account this script output should list multiple users for AppX apps that get deployed per user. This will help you identify which AppX apps need to be removed because they will cause issues with Sysprep. I want to qualify that with the following. There are only certain apps that can be removed without causing issues so please proceed with caution. Luckily for you I’ve already generated several simple scripts based on what apps can safely be removed.
AppX Removal Script #1 – The Long Version
Noting my previous
AppX article,
this script is a variation on those scripts that I’ve refined quite a bit. I came to the realization after writing that article that for a majority of the scenarios I could think of most people would want to remove the particular Installed AppX package as well as remove provisioning so the apps don’t install themselves under new accounts. So knowing that I condensed both scripts into one and cleaned them up to explicitly remove only what is necessary. I set only what I typically remove in my own VDI deployments to be removed. I added some commented out commands if people feel the need to remove Calculator they can. Although I don’t recommend it of course. Who doesn’t use Calculator every now and then?
Anyway, I’m assuming here you’ve already set the
Execution Policy
on your image to
Unrestricted
. The following has been tested on
Windows 10 – 1703
and
Windows 10 -1709
.
#VirtuallyInclined.com 2018
#You may have to manually uninstall some Sponsored Apps from the Start Menu.
#This has been tested on Windows 10 Enterprise 1703 and 1709.
#This is the long version of this script with each command explicitly defined.
Import-Module AppX
Import-Module Dism
#Use "#" to comment out apps you don't want to remove.
#You must comment out both commands for each app.
#The Remove-AppXpackage and Remove-AppXProvisionedPackage must both be commented out.
#Remove AppX Packages for unnecessary Windows 10 AppX Apps
Get-AppxPackage *Microsoft.BingNews* | Remove-AppxPackage
Get-AppxPackage *Microsoft.DesktopAppInstaller* | Remove-AppxPackage
Get-AppxPackage *Microsoft.GetHelp* | Remove-AppxPackage
Get-AppxPackage *Microsoft.Getstarted* | Remove-AppxPackage
Get-AppxPackage *Microsoft.Messaging* | Remove-AppxPackage
Get-AppxPackage *Microsoft.Microsoft3DViewer* | Remove-AppxPackage
Get-AppxPackage *Microsoft.MicrosoftOfficeHub* | Remove-AppxPackage
Get-AppxPackage *Microsoft.MicrosoftSolitaireCollection* | Remove-AppxPackage
Get-AppxPackage *Microsoft.NetworkSpeedTest* | Remove-AppxPackage
Get-AppxPackage *Microsoft.Office.OneNote* | Remove-AppxPackage
Get-AppxPackage *Microsoft.Office.Sway* | Remove-AppxPackage
Get-AppxPackage *Microsoft.OneConnect* | Remove-AppxPackage
Get-AppxPackage *Microsoft.People* | Remove-AppxPackage
Get-AppxPackage *Microsoft.Print3D* | Remove-AppxPackage
Get-AppxPackage *Microsoft.RemoteDesktop* | Remove-AppxPackage
Get-AppxPackage *Microsoft.SkypeApp* | Remove-AppxPackage
Get-AppxPackage *Microsoft.StorePurchaseApp* | Remove-AppxPackage
Get-AppxPackage *Microsoft.WindowsAlarms* | Remove-AppxPackage
Get-AppxPackage *Microsoft.WindowsCamera* | Remove-AppxPackage
Get-AppxPackage *microsoft.windowscommunicationsapps* | Remove-AppxPackage
Get-AppxPackage *Microsoft.WindowsFeedbackHub* | Remove-AppxPackage
Get-AppxPackage *Microsoft.WindowsMaps* | Remove-AppxPackage
Get-AppxPackage *Microsoft.WindowsSoundRecorder* | Remove-AppxPackage
Get-AppxPackage *Microsoft.Xbox.TCUI* | Remove-AppxPackage
Get-AppxPackage *Microsoft.XboxApp* | Remove-AppxPackage
Get-AppxPackage *Microsoft.XboxGameOverlay* | Remove-AppxPackage
Get-AppxPackage *Microsoft.XboxIdentityProvider* | Remove-AppxPackage
Get-AppxPackage *Microsoft.XboxSpeechToTextOverlay* | Remove-AppxPackage
Get-AppxPackage *Microsoft.ZuneMusic* | Remove-AppxPackage
Get-AppxPackage *Microsoft.ZuneVideo* | Remove-AppxPackage
#Remove AppX Packages for Sponsored Windows 10 AppX Apps
Get-AppxPackage *EclipseManager* | Remove-AppxPackage
Get-AppxPackage *ActiproSoftwareLLC* | Remove-AppxPackage
Get-AppxPackage *AdobeSystemsIncorporated.AdobePhotoshopExpress* | Remove-AppxPackage
Get-AppxPackage *Duolingo-LearnLanguagesforFree* | Remove-AppxPackage
Get-AppxPackage *PandoraMediaInc* | Remove-AppxPackage
Get-AppxPackage *CandyCrush* | Remove-AppxPackage
Get-AppxPackage *Wunderlist* | Remove-AppxPackage
Get-AppxPackage *Flipboard* | Remove-AppxPackage
Get-AppxPackage *Twitter* | Remove-AppxPackage
Get-AppxPackage *Facebook* | Remove-AppxPackage
Get-AppxPackage *Spotify* | Remove-AppxPackage
#Optional: Typically not removed but you can if you need to for some reason
#Get-AppxPackage *Microsoft.Advertising.Xaml_10.1712.5.0_x64__8wekyb3d8bbwe* | Remove-AppxPackage
#Get-AppxPackage *Microsoft.Advertising.Xaml_10.1712.5.0_x86__8wekyb3d8bbwe* | Remove-AppxPackage
#Get-AppxPackage *Microsoft.BingWeather* | Remove-AppxPackage
#Get-AppxPackage *Microsoft.MSPaint* | Remove-AppxPackage
#Get-AppxPackage *Microsoft.MicrosoftStickyNotes* | Remove-AppxPackage
#Get-AppxPackage *Microsoft.Windows.Photos* | Remove-AppxPackage
#Get-AppxPackage *Microsoft.WindowsCalculator* | Remove-AppxPackage
#Get-AppxPackage *Microsoft.WindowsStore* | Remove-AppxPackage
#Use "#" to comment out apps you don't want to remove.
#You must comment out both commands for each app.
#The Remove-AppXpackage and Remove-AppXProvisionedPackage must both be commented out.
#Remove AppX Provisioning for unnecessary Windows 10 AppX apps
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.DesktopAppInstaller" | Remove-AppxProvisionedPackage -Online
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.GetHelp" | 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.Microsoft3DViewer" | 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.OneConnect" | Remove-AppxProvisionedPackage -Online
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.People" | Remove-AppxProvisionedPackage -Online
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.Print3D" | Remove-AppxProvisionedPackage -Online
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.SkypeApp" | Remove-AppxProvisionedPackage -Online
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.StorePurchaseApp" | Remove-AppxProvisionedPackage -Online
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.WindowsAlarms" | Remove-AppxProvisionedPackage -Online
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.WindowsCamera" | 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.WindowsMaps" | Remove-AppxProvisionedPackage -Online
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.WindowsSoundRecorder" | Remove-AppxProvisionedPackage -Online
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.Xbox.TCUI" | Remove-AppxProvisionedPackage -Online
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.XboxApp" | Remove-AppxProvisionedPackage -Online
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.XboxGameOverlay" | Remove-AppxProvisionedPackage -Online
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.XboxIdentityProvider" | Remove-AppxProvisionedPackage -Online
Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.XboxSpeechToTextOverlay" | 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
#Sponsored Windows 10 AppX apps don't have corresponding provisioning packages
#Optional: Typically not removed but you can if you need to for some reason
#Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.BingWeather" | Remove-AppxProvisionedPackage -Online
#Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.MSPaint" | Remove-AppxProvisionedPackage -Online
#Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.MicrosoftStickyNotes" | Remove-AppxProvisionedPackage -Online
#Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.Windows.Photos" | Remove-AppxProvisionedPackage -Online
#Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.WindowsCalculator" | Remove-AppxProvisionedPackage -Online
#Get-AppxProvisionedPackage -Online | where Displayname -EQ "Microsoft.WindowsStore" | Remove-AppxProvisionedPackage -Online
If you’ve followed the rules I detailed above this script should work without issue. Remember though that any Sponsored Apps will potentially install themselves through the Windows Store. The only way to stop that is to disable the components that auto-download updates and Sponsored Apps which I will talk about later in this article.
AppX Removal Script #2 – The Shorter Version
Ok so I’ve seen variations on this script all over the internet. The problem though is they are usually too heavy-handed and basically just remove everything which of course we don’t necessarily want to do. Here I’ve adjusted the script according to my curated list of safe to remove AppX apps and included the Sponsored Apps most commonly installed.
Again
, I’m assuming here you’ve already set the
Execution Policy
on your image to
Unrestricted
. The following has been tested on
Windows 10 – 1703
and
Windows 10 -1709
.
#VirtuallyInclined.com 2018
#You may have to manually uninstall some Sponsored Apps from the Start Menu.
#This has been tested on Windows 10 Enterprise 1709 and 1703.
#This is the short version of this script with a variable including all the apps and a loop that runs
#Remove-AppXPackage and Remove-AppXProvisionedPackage on each app called by the variable.
#This unnecessarily runs against some apps that don't have corresponding provisioning packages
#due to the loop.
Import-Module AppX
Import-Module Dism
#Use "#" to comment out apps you don't want to remove in the AppXApps variable
$AppXApps = @(
#Unnecessary Windows 10 AppX Apps
"*Microsoft.BingNews*"
"*Microsoft.DesktopAppInstaller*"
"*Microsoft.GetHelp*"
"*Microsoft.Getstarted*"
"*Microsoft.Messaging*"
"*Microsoft.Microsoft3DViewer*"
"*Microsoft.MicrosoftOfficeHub*"
"*Microsoft.MicrosoftSolitaireCollection*"
"*Microsoft.NetworkSpeedTest*"
"*Microsoft.Office.OneNote*"
"*Microsoft.Office.Sway*"
"*Microsoft.OneConnect*"
"*Microsoft.People*"
"*Microsoft.Print3D*"
"*Microsoft.RemoteDesktop*"
"*Microsoft.SkypeApp*"
"*Microsoft.StorePurchaseApp*"
"*Microsoft.WindowsAlarms*"
"*Microsoft.WindowsCamera*"
"*microsoft.windowscommunicationsapps*"
"*Microsoft.WindowsFeedbackHub*"
"*Microsoft.WindowsMaps*"
"*Microsoft.WindowsSoundRecorder*"
"*Microsoft.Xbox.TCUI*"
"*Microsoft.XboxApp*"
"*Microsoft.XboxGameOverlay*"
"*Microsoft.XboxIdentityProvider*"
"*Microsoft.XboxSpeechToTextOverlay*"
"*Microsoft.ZuneMusic*"
"*Microsoft.ZuneVideo*"
#Sponsored Windows 10 AppX Apps
#Add sponsored/featured apps to remove in the "*AppName*" format
"*EclipseManager*"
"*ActiproSoftwareLLC*"
"*AdobeSystemsIncorporated.AdobePhotoshopExpress*"
"*Duolingo-LearnLanguagesforFree*"
"*PandoraMediaInc*"
"*CandyCrush*"
"*Wunderlist*"
"*Flipboard*"
"*Twitter*"
"*Facebook*"
"*Spotify*"
#Optional: Typically not removed but you can if you need to for some reason
#"*Microsoft.Advertising.Xaml_10.1712.5.0_x64__8wekyb3d8bbwe*"
#"*Microsoft.Advertising.Xaml_10.1712.5.0_x86__8wekyb3d8bbwe*"
#"*Microsoft.BingWeather*"
#"*Microsoft.MSPaint*"
#"*Microsoft.MicrosoftStickyNotes*"
#"*Microsoft.Windows.Photos*"
#"*Microsoft.WindowsCalculator*"
#"*Microsoft.WindowsStore*"
foreach ($App in $AppXApps) {
Get-AppxPackage -Name $App | Remove-AppxPackage
Get-AppxProvisionedPackage -Online | Where-Object DisplayName -like $App | Remove-AppxProvisionedPackage -Online
This script and the first don’t do anything functionally different. They both remove the same AppX Packages and remove the same AppX Provisioning packages. The second script actually runs a few Remove-AppXProvisionedPackage commands that it doesn’t need to against provisioned packages that don’t exist since it’s running a loop against the list. Both the first and second script work perfectly well and allow for customization. The third script however is just awesome and works in those situations you need to customize what you remove across different images and don’t want to hassle with changing scripts.
Once again, I’m assuming here you’ve already set the Execution Policy on your image to Unrestricted. The following has been tested on Windows 10 – 1703 and Windows 10 -1709.
#VirtuallyInclined.com 2018
#You may have to manually uninstall some Sponsored Apps from the Start Menu.
#This has been tested on Windows 10 Enterprise 1703 and 1709.
#This is a different method to individually select the packages that you would like to remove.
Import-Module AppX
Import-Module Dism
Write-Warning "Select AppX Packages to remove..."
Get-AppxPackage | Out-GridView -Title "Select AppX Packages to remove" -PassThru | Remove-AppxPackage
Write-Warning "Select AppX Provisioning Packages to remove..."
Get-AppxProvisionedPackage -Online | Out-GridView -Title "Select AppX Provisioned Packages to remove" -PassThru | Remove-AppxProvisionedPackage -Online
This script opens a GUI based dialog box and you just multi-select what you want to remove and click OK to remove the selected AppX apps. The first part opens a dialog to remove the installed packages. The second part removes the provisioning packages ensuring that the AppX apps you choose to remove don’t auto-install under new user accounts. The beauty of this method is you select exactly what you want to remove without having to adjust any scripts. It’s also a nice and quick way to see which AppX packages or provisioning packages are installed on each user account or to validate that you’ve actually removed what you want to remove. You can run this again after you’ve removed AppX apps with it and remove additional apps or verify there’s nothing else to remove and you can just hit Cancel to exit the dialog boxes so you don’t remove anything else.
The only downside with this script is you must have a fairly good understanding of which apps you can and cannot remove. I won’t go into detail too much on that other than to point you to the other scripts to get a good idea of what I would consider safe to remove. I’ll also share this blog post that has a pretty decent description of most of the AppX packages as well as further suggestions on AppX apps that are safe to remove.
Conclusion
I’ve detailed how to avoid causing the Sysprep issue as well as given you three ways to remove AppX Packages and AppX provisioning Packages. But wait a minute! How do I stop the Windows Store from auto-downloading Sponsored Apps or AppX Package updates? Well there are 3 possibilities here that I’ll briefly describe.
Disable Windows Store Automatic Updates (Registry)
Disable Windows Store InstallService (from an elevated Command Prompt)
net stop InstallService
sc config InstallService start=disabled
Each of these individually may help alleviate issues with AppX and Sysprep but like anything use these with caution. You will be disabling parts of the Windows Store disallowing certain interaction with the Windows Store.
So there you are. I’ve given you the tools! Good luck and I hope this update provides some additional help working through these issues. Thanks for reading my blog!
Hey Shawn, I followed your directions but I’m still having the provisioned apps getting reinstalled on new user accounts. I installed Windows 10 in a VM with no internet connectivity, only had one user account created, ran the long version script and then created a new account and connected the VM to the internet and the apps were there. Any suggestions on why this is happening?
So the Sponsored Apps will potentially reinstall regardless of removal unless you disable them by using one of the methods I described at the bottom of the article. Can you tell me which apps are popping back in? You may also just be seeing the shortcut but the app isn’t actually installed. I’ve seen that a few times.
Shawn,
I may have been too quick to say it didn’t work, looks like after a reboot the provisioned apps are no longer there. Like you said though, the sponsored apps are reappearing. I used your suggestions at the end of the article and the first two worked but I can’t stop the Windows Store InstallService. It doesn’t see it as a legitimate service name. I’m using the Pro version of Windows, and the GPO to disable the store doesn’t seem to work with my version (Only Education and Enterprise versions from what I’ve read). I know I’m being picky but I don’t like the look of these apps in a professional deployment.
From what I’ve gathered is there are AppX packages that is somehow interfering with the Provisioning removal. I don’t know which ones, but if I were to use the cmd >
“Get-AppxPackage -AllUsers | Remove-AppxPackage”
Then any of the Provisioning packages can be removed.
When running the AppX packages to remove thru the Out-GridView, all of the packages I selected to remove are gone. So which Appx package is interfering with the provision removal?
E.g. > Microsoft.GetHelp package is removed, but the provision package will not remove and you get the error above.
Even when manually doing this I continue to get the Remove-AppxProvisionedPackage : Unspecified error:
“Get-AppxPackage *GetHelp* | Remove-AppxPackage”
I’m in the middle of building an 1803 image now and used my own scripts without issue. I haven’t seen this issue yet. Make sure you check syntax and import the Appx and Dism modules. You also might run the other command “Get-AppxPackage -AllUser | FL -Property PackageFullName,PackageUserInformation > c:\appx.txt” to make sure you don’t have a broken manifest or something. Very strange. Let me know if that helps. Thanks for reading and commenting!
I am taking the approach of picking out one Package/Provision to test this now.
I used the other command you suggested and it shows “GetHelp” package as “Staged”. Which I understand means that the AppX package was removed from the Admin account I’m logged into(as expected), but the Provision will exist for install on any users logging in the image later. So when removing the Provision for a given PackageFullName this would no longer be present in the output correct?
Outside of that, nothing stands out on the rest of the list. All Packages I had removed show “Staged” and ones that were left show “Installed” for the account used. Just for sake of mentioning it – only the Admin account is used when creating the image.
Not sure this would matter, but I didn’t mention this is using an Enterprise version of Win10 1803.
I’m going to go back and do a fresh install, no configuring (as I’ve done some minor software installs and configure before going through the Package/Provision removal process – albeit this has worked seamlessly since 1511) and see what happens.
What’s got me is that if I removal all Packages from the current account (Get-AppxPackage -AllUsers | Remove-AppxPackage) the Provision removal works just fine. This makes me suspect some Package is affecting this removal process. Like when Sysprep messes up when a package is still installed for the account used.
Well I have re-tested this and it does indeed work with no adjustments or config to the image (1803).
During some part of my config it effected this from working fully. So I’ve changed my procedures to do this right in the being prior to any other configuration changes (to be safe).
The only thing I noted was that the Bing Weather (which we keep for users) didn’t want to play nicely during sysprep and I had to remove it. May need to go through once more to see if something I selected in the PS scripting effected it.
Thanks for having the blog/scripts and appreciate the help.
This is doing my head in. First, thanks to those who have gone before us.
I’m trying to SysPrep an image using the pre-installed OS on various Lenovo products. The latest two to fail are a T480 and an E580. Wiping them clean and installing the ‘clean’ Win10 1803 image we have on our WDS doesn’t seem to change the fact that they’re failing. I have a bit more trial and error to go through, but the latest testing on both models mentioned suggests that even with the scripts run, that they fail. I did however, upgrade the drivers via Lenovo tools and noticed that Windows moved up automagically from 1709 (the image on both machines) to 1803.
I only have the one user other than the native Win10 ones – named User. It’s reporting that it’s failing on Dolby right now, but it seems to fail on any number of the apps.
Some guidance would be appreciated because we deploy large numbers of product here and I’m *the* guy who owns this process and am sick of it breaking! Here’s my logs:
2018-08-23 13:15:22, Error SYSPRP Package DolbyLaboratories.DolbyAccess_2.3.301.0_x64__rz1tebttyb220 was installed for a user, but not provisioned for all users. This package will not function properly in the sysprep image.
2018-08-23 13:15:22, Error SYSPRP Failed to remove apps for the current user: 0x80073cf2.
2018-08-23 13:15:22, Error SYSPRP Exit code of RemoveAllApps thread was 0x3cf2.
Hey Jay sorry to hear it’s not going well. I was looking at your list and you should try removing the following from all enabled user accounts and then try Sysprep again.
I also noticed that there are references to unnamed SIDs which may mean the AppX manifest is referencing a user that no longer exists. The problem that may present is your manifest is corrupt and there may be no way to fix the Sysprep issues. I would use a non-Lenovo disk/usb/iso/dvd to install Windows. I might even suggest getting a clean ISO straight from the Microsoft VLSC, don’t install any Lenovo software except for the drivers you absolutely need and see what happens. I have an article series coming out next week that details my steps for building a Horizon View –
Windows 10 image but it also could be used as a baseline to potentially avoid issues like this. I hope that helps and thanks for reading!
I’m with Shawn on installing a brand new fresh image. Go into Audit mode and temporarily activate the Administrator account (no other accounts should be created). Then removing all the provisions you don’t want just then and there. If you can do this via a VM it is much better and you can take snapshots along the way. Put drivers on your computers after you drop the golden image on it.
Set up everything else under that Admin profile (as this can be used to CopyProfile in Sysprep). When you Sysprep the Admin account will be disabled again, just don’t forget to create a new admin account in your AnswerFile. This is done under oobeSystem > Windows-shell-setup > FirstLogonCommands and UserAccounts
Thanks for the great articles! I’ve happened upon your site and feel like I’ve found Gold! Anyway, quick question. What if you have a golden image that has three of four users that have logged into it, AND some of them are gone from the company and the AD account is deleted? I’m assuming deleting the user profile is NOT GOOD. So how would you address something like this scenario? Am I just screwed on this image? Time to start over?
Hi Shawn I found your blog from Google. I am running Windows 10 and have noticed strange behavior. When I ran the powershell script I had my only user account and then a number of other entries with the short registry name similar to the above. Is there a way to email you to discuss with additional information?