次の方法で共有


Removing Windows 8.1 Built-in Applications

Last year I published a PowerShell script that is designed to remove the built-in Windows 8 applications when creating a Windows 8 image. Well now that Windows 8.1 has been released we must update the PowerShell script to work with Windows 8.1.

The script below takes a simple list of Apps and then removes the provisioned package and the package that is installed for the Administrator. To adjust the script for your requirements simply update the $AppList comma separated list to include the Apps you want to remove. The script is designed to work as part of an MDT or Configuration Manager task sequence. If it detects that you are running the script within a task sequence it will log the to the task sequence folder otherwise it will log to the Windows\temp folder.

<#    
    ************************************************************************************************************
    Purpose:    Remove built in apps specified in list
    Pre-Reqs:    Windows 8.1
    ************************************************************************************************************
#>

#---------------------------------------------------------------------------------------------------------------
# Main Routine
#---------------------------------------------------------------------------------------------------------------

# Get log path. Will log to Task Sequence log folder if the script is running in a Task Sequence
# Otherwise log to \windows\temp

try

{

$tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment

$logPath = $tsenv.Value("LogPath")

}

catch

{

Write-Host "This script is not running in a task sequence"

$logPath = $env:windir + "\temp"

}

$logFile = "$logPath\$($myInvocation.MyCommand).log"

# Start logging

Start-Transcript $logFile

Write-Host "Logging to $logFile"

# List of Applications that will be removed

$AppsList = "microsoft.windowscommunicationsapps","Microsoft.BingFinance","Microsoft.BingMaps",`

"Microsoft.BingWeather","Microsoft.ZuneVideo","Microsoft.ZuneMusic","Microsoft.Media.PlayReadyClient.2",`

"Microsoft.XboxLIVEGames","Microsoft.HelpAndTips","Microsoft.BingSports",`

"Microsoft.BingNews","Microsoft.BingFoodAndDrink","Microsoft.BingTravel","Microsoft.WindowsReadingList",`

"Microsoft.BingHealthAndFitness","Microsoft.WindowsAlarms","Microsoft.Reader","Microsoft.WindowsCalculator",`

"Microsoft.WindowsScan","Microsoft.WindowsSoundRecorder","Microsoft.SkypeApp"

ForEach ($App in $AppsList)

{

$Packages = Get-AppxPackage | Where-Object {$_.Name -eq $App}

if ($Packages -ne $null)

{

      Write-Host "Removing Appx Package: $App"

      foreach ($Package in $Packages)

      {

      Remove-AppxPackage -package $Package.PackageFullName

      }

}

else

{

      Write-Host "Unable to find package: $App"

}

$ProvisionedPackage = Get-AppxProvisionedPackage -online | Where-Object {$_.displayName -eq $App}

if ($ProvisionedPackage -ne $null)

{

      Write-Host "Removing Appx Provisioned Package: $App"

      remove-AppxProvisionedPackage -online -packagename $ProvisionedPackage.PackageName

}

else

{

      Write-Host "Unable to find provisioned package: $App"

}

}

# Stop logging

Stop-Transcript

When removing applications from Windows 8.1 it is important that you also create and deploy a custom start screen layout using the  export-layout PowerShell command. See my previous blog on how to customize the start screen for more guidance - https://blogs.technet.com/b/deploymentguys/archive/2012/10/26/start-screen-customization-with-mdt-.aspx?pi36647=2.

For more information on adding and removing apps please refer to this TechNet article.

This post was contributed by Ben Hunter , a Senior Product Marketing Manager with Microsoft

Disclaimer: The information on this site is provided "AS IS" with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the Terms of Use .

Comments

  • Anonymous
    January 01, 2003
    Hi, any chance to remove Photos App?

  • Anonymous
    January 01, 2003
    afaik: the Package "microsoft.windowscommunicationsapps" contains the Mai and chat apps (and a few others) :)

  • Anonymous
    January 01, 2003
    Hi Dan,

    This is a PowerShell script. It will not work with VBS.

    Ben

  • Anonymous
    January 01, 2003
    Great Script, but two questions : In the script I see twice "Microsoft.Media.PlayReadyClient.2" is this a mistake ? and what application is "microsoft.windowscommunicationsapps"

  • Anonymous
    January 01, 2003
    thanks

  • Anonymous
    January 01, 2003
    Very nice Script Ben, thanks for sharing this.

  • Anonymous
    January 01, 2003
    I don't know how the PlayReadyClient got in the script twice, it must have been a cut and paste error :). I have fixed it now.The communications apps are the People, calendar, and mail apps.Thanks,Ben

  • Anonymous
    January 01, 2003
    Hi Peber,

    When a new user logs on for the first time the provisioned apps are installed for each user, this is most likely causing the long logon times. However 10-15 minutes is much longer than I have seen even with all apps installed.

    The logon times should be reduced after the apps are removed although I am not sure if this is the cause for you as your script essentially does the same thing as mine.

    Have you confirmed that the provisioned packages are actually being removed by using Get-appxprovisonedpackage -online after the removal process

    Thanks,
    Ben

  • Anonymous
    November 07, 2013
    Nice, but what is the different to this code? Powershell: get-appxpackage | remove-appxpackage

  • Anonymous
    November 07, 2013
    Hi Bernd, This script is designed to remove both installed and provisioned packages. It also gives you the  ability to remove the packages you list rather than all packages. There are some packages that may not want to remove and this gives you the option to be selective :). Thanks, Ben

  • Anonymous
    November 23, 2013
    Ben - Awesome post! A few comments. Under "Windows PowerShell ISE", Powershell v4.0, BuildVersion  6.3.9600.16394, in a Windows 8.1 workstation, I elevated permissions to "ExecutionPolicy: RemoteSigned" Still, I see - (1) "This host does not support transcription" (2) "Get-AppxProvisionedPackage : The requested operation requires elevation." Any thoughts?

  • Anonymous
    December 03, 2013
    The comment has been removed

  • Anonymous
    December 08, 2013
    The comment has been removed

  • Anonymous
    December 19, 2013
    Update - This script will not work with Windows 8.1 a script for Windows 8.1 can be found here - http

  • Anonymous
    December 23, 2013
    Pingback from Windows 8.1: Die eingebaute Apps entfernen thema | germa2

  • Anonymous
    January 08, 2014
    Remove built in Windows 8.1 Apps with Powershell

  • Anonymous
    January 22, 2014
    How can i run this for all New users that sign in if im not using it to build a reference image and copying the Administrators profile?

  • Anonymous
    January 24, 2014
    I need to confirm im using this script correctly. I build a reference image with install.wim from 8.1 enterprise media . I run this script with TS ( or even manually while i have TS suspended) It does remove all the unwanted apps for the administrators account. I resume the TS to sysprep and capture the WIM. I then deploy the wim through a standard TS new computer deployment. Once its done i log into Administrator ( or any account) and all the apps i removed are back with "Error" and do not launch. Any help would be great.

  • Anonymous
    January 25, 2014
    I figured out my issue was with the reference image being syspreped already with the copyprofile already done before final deployment. The Script works very well... thank you.

  • Anonymous
    January 29, 2014
    I am getting an error "unable to find provisioned package". It removes the installed packages fine.. but not the provisioned ones.

  • Anonymous
    March 19, 2014
    Some packages cannot be removed from the script. As to the question about the copying of the profile, I think a combination of export start menu PowerShell CmdLet mixed with this video should work pretty good,

    http://www.deploymentresearch.com/Research/tabid/62/EntryId/43/How-CopyProfile-really-works-in-Windows-7-Deployments.aspx

    Thanks again Ben for the script I only modified the start-transcript to work differently in logging because of the way I run the TS step

  • Anonymous
    March 26, 2014
    Is there any way to remove the Photos, Camera, and SkyDrive/OneDrive tile in Windows 8.1? This appears to have changed from 8.0 as there is no package to be removed any more.

  • Anonymous
    April 07, 2014
    what does this mean? can I please a simpler version

  • Anonymous
    April 08, 2014
    I think we can't uninstall Skydrive and Windows store from the above script?
    is it true?

  • Anonymous
    April 08, 2014
    Please update this script for Windows 8.1 Update :)

  • Anonymous
    April 09, 2014
    Ben, the script works great if I run it manually on a PC! However, when I add it to a Task Sequence it runs and generates a log file in the %windir%/temp folder, but no apps are removed. Any suggestions?

    Here is the error for one app from the log file (it then continues to the next app generating the same error for each one listed in the script)...

    Removing Appx Package: microsoft.windowscommunicationsapps
    Get-AppxProvisionedPackage : An attempt was made to load a program with an
    incorrect format.
    At C:SMSTaskSequencePackagesABC0002BRemoveWin8Apps.ps1:48 char:27
    + $ProvisionedPackage = Get-AppxProvisionedPackage -online | Where-Object
    {$
    . ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Get-AppxProvisionedPackage],
    COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.GetAppxProvisionedPackag
    eCommand

    Unable to find provisioned package: microsoft.windowscommunicationsapps

  • Anonymous
    April 28, 2014
    Many Many thanks, got my cto off my back after running this script to remove the apps that slow down new user first login.

  • Anonymous
    May 29, 2014
    Pingback from Windows 8.1 Reference Image Planning Checklist | trekker.net

  • Anonymous
    May 29, 2014
    Pingback from Windows 8.1 Reference Image Planning Checklist | trekker.net

  • Anonymous
    June 01, 2014
    Ben,

    Can you explain me what the exact difference are between this script and the following commands in case of extremely long first logon times?

    Get-appxpackage -allusers | remove-appxpackage

    Get-appxprovisonedpackage -online | remove-appxprovisionedpackage -online

    I used the commands to delete apps but facin' extremely long first logon times.

    About 10 - 15 minutes.

    Are they gone after using this script in master image?





  • Anonymous
    June 12, 2014
    I am getting the same result as Nick (April 9 command above) - it works great if I run it from an admin command prompt, however fails to remove apps, and logs the following messages to the log file when running via SCCM package (set to run with admin rights, whether a user is logged on or not)


    Removing Appx Package: microsoft.windowscommunicationsapps
    Get-AppxProvisionedPackage : An attempt was made to load a program with an
    incorrect format.
    At C:SMSTaskSequencePackagesABC0002BRemoveWin8Apps.ps1:48 char:27
    + $ProvisionedPackage = Get-AppxProvisionedPackage -online | Where-Object
    {$
    . ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [Get-AppxProvisionedPackage],
    COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.GetAppxProvisionedPackag
    eCommand

    Unable to find provisioned package: microsoft.windowscommunicationsapps

  • Anonymous
    June 26, 2014
    how to fix when
    remove-AppxProvisionedPackage : The system cannot find the file specified.

  • Anonymous
    June 26, 2014
    How to fix when

    Get-appxprovisonedpackage -online | remove-appxprovisionedpackage -online
    find packages and cannot remove (Case path really do not exist, just some other Versions of it)

    DISM Appx Provider: PID=9028 TID=8408 Failed to open 'C:Program FilesWindowsAppsMicrosoft.BingNews_2014.326.2203.2627_neutral_~8wekyb3d8bbweAppxMetadataAppxBundleManifest.xml'. - CPackageAdapter::CreateForRemove(hr:0x80070003)
    DISM Appx Provider: PID=9028 TID=8408 Failed while initializing package adapter for package 'Microsoft.BingNews_2014.326.2203.2627_neutral
    ~8wekyb3d8bbwe' - CAppxManager::RemoveAllUserAppx(hr:0x80070003)
    DISM Appx Provider: PID=9028 TID=8408 Failed to remove package 'Microsoft.BingNews_2014.326.2203.2627_neutral
    ~_8wekyb3d8bbwe' - CAppxManager::ProcessCommandRemoveAllUserAppx(hr:0x80070003)
    DISM Appx Provider: PID=9028 TID=8408 Failed processing command to remove Appx package - CAppxManager::ExecuteCmdLine(hr:0x80070003)

  • Anonymous
    July 20, 2014
    Hi, this script gives me "remove-AppxProvisionedPackage : Access is denied." for each package, what am I doing wrong?

  • Anonymous
    September 01, 2014
    Hi, any chance to remove Photos App, SkyDrive, Camera and Internet Explorer?

  • Anonymous
    September 02, 2014
    The comment has been removed

  • Anonymous
    September 23, 2014
    John/Rohan
    I use this script to remove those apps from the start screen. Granted doesnt completely remove the apps but is a start. Skydrive needs a group policy to be applied and I havent seen anything else yet to resolve.

    Question I have is the same as Peber. When I just use these lines in my mdt reference image. The apps are removed but when I laydown the image with SCCM 2012 r2 all the apps are there again. I have copyprofile set in the settings package unattend.xml I am using when I lay down the wim but it's as if copyprofile isnt processing.

    Powershell.exe -Command "&{Get-appxPackage -AllUsers | Remove-AppxPackage -ErrorAction SilentlyContinue}"
    Powershell.exe -Command "&{Get-AppXProvisionedPackage -online | Remove-AppxProvisionedPackage -online -ErrorAction SilentlyContinue}"


    # Clean Windows Store
    attrib "C:ProgramDataMicrosoftWindowsStart MenuProgramsWindows Store.lnk" -S
    attrib "C:ProgramDataMicrosoftWindowsStart MenuProgramsWindows Store.lnk" -R
    del /Q "C:ProgramDataMicrosoftWindowsStart MenuProgramsWindows Store.lnk"
    # Clean Photos App
    attrib "C:ProgramDataMicrosoftWindowsStart MenuProgramsPhotosApp.lnk" -S
    attrib "C:ProgramDataMicrosoftWindowsStart MenuProgramsPhotosApp.lnk" -R
    del /Q "C:ProgramDataMicrosoftWindowsStart MenuProgramsPhotosApp.lnk"
    # Clean OneDrive
    attrib "C:ProgramDataMicrosoftWindowsStart MenuProgramsFileManager.lnk" -S
    attrib "C:ProgramDataMicrosoftWindowsStart MenuProgramsFileManager.lnk" -R
    del /Q "C:ProgramDataMicrosoftWindowsStart MenuProgramsFileManager.lnk"
    # Clean Camera
    attrib "C:ProgramDataMicrosoftWindowsStart MenuProgramsCamera.lnk" -S
    attrib "C:ProgramDataMicrosoftWindowsStart MenuProgramsCamera.lnk" -R
    del /Q "C:ProgramDataMicrosoftWindowsStart MenuProgramsCamera.lnk"

  • Anonymous
    December 03, 2014
    How do you run this?
    Tried copy and pasting into a vbs file and it gives a compilation error.
    Thanks

  • Anonymous
    December 11, 2014
    This freezes on each app. I have to ctrl + c it after each app uninstall. It does remove them one-by-one provided I continue stopping and manually restarting the script.

  • Anonymous
    December 13, 2014
    Ben,

    This works great. Thank you for the script to use. When I run this in a TS out of MDT 2013, the logfile just shows the Transcript start and stop blocks. Any thoughts on what could be causing this. All of the apps are removed correctly.

  • Anonymous
    February 16, 2015
    Have some a powershell script to remove ms-reader .

  • Anonymous
    October 02, 2015
    This is brilliant thank you very much for sharing!!

  • Anonymous
    October 27, 2015
    Thanks Ben! This works great in Windows 10 as well, I just needed to change the list to match the updated app names.

  • Anonymous
    November 11, 2015
    A couple of years ago, Ben Hunter posted a script on the Deployment Guys blog that showed how to remove

  • Anonymous
    March 04, 2016
    Can I use this for windows 10?