Share via


Problem with Remove-AppxProvisionedPackage on a fresh install of Windows 10 Enterprise build 1803

Question

Tuesday, August 14, 2018 5:20 PM | 1 vote

Problem with Remove-AppxProvisionedPackage on a fresh install of Windows 10 Enterprise build 1803

If I run the following command:-

  Remove-AppxProvisionedPackage  -online -packagename  Microsoft.BingWeather_4.22.3254.0_neutral_~_8wekyb3d8bbwe

 I get the following error:-

         Remove-AppxProvisionedPackage : Unspecified error
         At line:1 char:1
         Remove-AppxProvisionedPackage  -online -packagename  Microsoft.BingWe ...
         + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
         + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

Package name not relevant as does it with any package I choose

Package is definitely installed as when I run Get-AppxProvisionedPackage-online | select displayname,packagename it shows in list

Any thoughts please

Darren Rose

All replies (5)

Wednesday, August 15, 2018 9:24 AM

Hi Darren,

Yes, I can reproduce this problem.

The same command can run successfully on Windows 10 1709 but failed on Windows 10 1803.

I will submit this feedback via our own channel.

If any update, I will let you know as soon as possible.

Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].


Wednesday, August 15, 2018 11:14 AM

Thanks Karen

Seems to also be a fundamental problem with sysprep on 1803 - if you run it even on a clean install it fails with

"Sysprep was not able to validate your Windows installation.  Review the log file at %WinDir%\System32\Sysprep\Panther\Setupact.logfor details.  After resolving the issue, use Sysprep to validate your installation again"

And that is a on a clean install with nothing changed relating to apps - setupact.log shows entry as below

"2018-08-07 19:56:45, Error   SYSPRP Package Microsoft.LanguageExperiencePacken-gb_17134.5.7.0_neutral__8wekyb3d8bbwe was installed for a user, but not provisioned for all users. This package will not function properly in the sysprep image"

So I think definitely something broken with 1803

Darren Rose


Thursday, August 16, 2018 7:57 PM | 1 vote

Hi,

Okay after lots of hours of work, restoring base images multiple times and reinstalling Windows 10 Enterprise 1803 more times that I can remember, I have it working.

The following code is what I use to remove apps, but unlike with 1709 where it just worked, with 1803 it fails and gives you an error (unspecified error … com exception) on some apps the first time you run it, so you have to run the remove-appxpackage section, reboot, run rest and then eventually it removes all apps correctly without error and sysprep will work

 Write-Host "Removing Apps..." -ForegroundColor Green
    Write-Host ""
    
    # Create array to hold list of apps to remove
    $appname = @(
        "*Microsoft.WindowsAlarms*"
        "*microsoft.windowscommunicationsapps*"
        "*Microsoft.WindowsFeedbackHub*"
        "*Microsoft.ZuneMusic*" 
        "*Microsoft.ZuneVideo*" 
        "*Microsoft.WindowsMaps*"
        "*Microsoft.Messaging*"
        "*Microsoft.MicrosoftSolitaireCollection*"
        "*Microsoft.MicrosoftOfficeHub*"
        "*Microsoft.Office.OneNote*"
        "*Microsoft.MSPaint*"
        "*Microsoft.WindowsSoundRecorder*"
        "*Microsoft.OneConnect*"
        "*Microsoft.Microsoft3DViewer*"
        "*Microsoft.BingWeather*"
        "*Microsoft.Xbox.TCUI*" 
        "*Microsoft.XboxApp*" 
        "*Microsoft.XboxGameOverlay*" 
        "*Microsoft.XboxGamingOverlay*" 
        "*Microsoft.XboxIdentityProvider*" 
        "*Microsoft.XboxSpeechToTextOverlay*" 
        "*Microsoft.Print3D*"
        "*Microsoft.LanguageExperiencePacken-gb*"
    )

    # Remove apps from current user
    ForEach($app in $appname){
    Get-AppxPackage -Name $app | Remove-AppxPackage -ErrorAction SilentlyContinue
    }

    # Remove apps from all users - may need to reboot after running above and run this again
    ForEach($app in $appname){
    Get-AppxPackage -Allusers -Name $app | Remove-AppxPackage -Allusers -ErrorAction SilentlyContinue
    }

    # Remove apps from provisioned apps list so they don't reinstall on new users
    ForEach($app in $appname){
    Get-AppxProvisionedPackage -Online | where {$_.PackageName -like $app} | Remove-AppxProvisionedPackage -Online -ErrorAction SilentlyContinue
    }

If above doesn't run correctly then when you run sysprep you get as follows:-

"Sysprep was not able to validate your Windows installation.  Review the log file at %WinDir%\System32\Sysprep\Panther\Setupact.log for details.  After resolving the issue, use Sysprep to validate your installation again"

and in the log entries such as

"Package Microsoft.BingWeather_4.22.3254.0_x64__8wekyb3d8bbwe was installed for a user, but not provisioned for all users. This package will not function properly in the sysprep image."

If you reboot and run app removal script again it then actually completes without error

You can then run sysprep without any errors

Oh what fun, but at least I now have working 1803 image to deploy

Really shouldn't need to be this much work though

Darren Rose


Thursday, October 18, 2018 6:06 PM

Darren, I just tried running your script and it removes the apps from the current user. However, when a new user logs in, the apps still appear. Am I doing something wrong?


Thursday, October 18, 2018 6:11 PM

Hi

Since my issue was back in August perhaps a more recent update has fixed the problem - this is assuming you are using 1803 and not 1809?

Certainly for me 1803 was definitely broken when it came to removing apps, running sysprep and then logging on as a new user

I assume you are sysprepping as well?

Darren Rose