Jump to content

Win10 + MDT - Remove Provisioned Apps = Nightmare


Recommended Posts

Posted

I'm having a bit of a nightmare here trying to remove the AppxProvisioned apps (XBox etc) from our Windows 10 builds. I've a PS script that when run manually, successfully removes all of the crap from the OS however when I add the same script to a MDT 2013 Task Sequence the script fails to run.

 

Does anyone deploy Win10 using solely MDT 2013? If so, would you be willing to share what commands you are using in the task sequence as well as where in the task sequence you are placing the commands?

 

I've tried all sorts to get this working however my current attempt is the following:

 

Under "State Restore" >>> "Custom Tasks" I have two separate "Run Command Line" tasks. The first specifies the following command powershell.exe -command "Set-ExecutionPolicy Bypass"

 

The second task is a "Run Command Line" task with the following command powershell.exe -file "%SCRIPTROOT%\Script.ps1"

 

I'm trying to use this on a 1703 64 bit build. How are you guys achieving this?

Posted

here you go, works with windows 10 edu 1703 x64, could do with extra tweaking but it works nonetheless at MDT 2013 stage

 

$AppsList = "Microsoft.3DBuilder","Microsoft.BingWeather","Microsoft.Getstarted","Microsoft.Messaging","Microsoft.MicrosoftOfficeHub","Microsoft.MicrosoftSolitaireCollection","Microsoft.OneConnect","Microsoft.People","Microsoft.SkypeApp","microsoft.windowscommunicationsapps","Microsoft.WindowsFeedbackHub","Microsoft.WindowsMaps","Microsoft.XboxApp","Microsoft.XboxIdendityProvider","Microsoft.ZuneMusic","Microsoft.ZuneVideo","Microsoft.DesktopAppinstaller","Microsoft.StorePurchaseApp","Microsoft.Wallet","Microsoft.WindowsStore","Microsoft.XboxGameOverlay","Microsoft.XboxSpeechToTextOverlay","Microsoft.WindowsAlarms","Microsoft.MicrosoftEdge"

   ForEach ($App in $AppsList) 
   { 
       $PackageFullName = (Get-AppxPackage $App).PackageFullName
       $ProPackageFullName = (Get-AppxProvisionedPackage -online | where {$_.Displayname -eq $App}).PackageName
        
       If ($PackageFullName) 
       { 
           Write-Verbose "Removing Package: $App"
           remove-AppxPackage -package $PackageFullName
       } 
       Else
       { 
           Write-Host "Unable to find package: $App"
       } 
 
       If ($ProPackageFullName) 
       { 
           Write-Verbose "Removing Provisioned Package: $ProPackageFullName"
           Remove-AppxProvisionedPackage -online -packagename $ProPackageFullName
       } 
       Else
       { 
           Write-Verbose "Unable to find provisioned package: $App"
       }
   }

  • Thanks 1
Posted

Thank you fellow Edugeeks. I used Luke's solution (just because it was the first I came too) and it now works! My original script mustn't have been compatible with this way of deployment (it worked when manually running it).

 

Thanks again as I've spent hours trying to sort this!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...