Windows 10’s Universal Windows Platform apps may possibly be Microsoft’s most unpopular decision – ever. What’s the current thinking on how we can deal with them in our environments?
Note:- this article refers to the removal process for Microsoft UWP (Universal Windows Platform) apps on Windows 10 version 1803, fully patched as of 05/07/2018. Further servicing updates (Windows patches) or feature updates (OS upgrades) will possibly invalidate this, although I will strive to keep this article as up-to-date as humanly possible.
It would be safe to say that UWP apps aren’t the most popular move that Microsoft have ever made, whether this be with end-users, administrators, or application developers. Not even a little bit popular, in my experience. So unpopular, in fact, that I hear Microsoft are actually pouring a lot of effort into (again) reinventing their apps platform, next time with something called MSIX (which may, to all intents and purposes, just be App-V 6.0 rebadged). But that’s something for future articles to discuss – right now, if you’re deploying Windows 10 or using it on Citrix XenApp or VMware Horizon, how do you shoehorn these annoying and quite-frankly-useless Windows 10 UWP apps out of your base image?
Let’s remind ourselves how Windows 10 UWP apps are deployed. They certainly aren’t like standard Windows applications, which we must now quaintly refer to as “legacy”.
A traditional “legacy” app is deployed to the device. The app is delivered to the device (in any one of a number of different ways), and the installation of this app places its associated filesystem and Registry entries locally to that device. When a user logs on, they access the device-specific data, and any user-specific customizations are saved off into areas of the user profile. Pretty straightforward, and the way we’ve done it for – well, since forever, really. Here’s a quick screenshot from a presentation I did about legacy versus UWP apps, showing the legacy app behaviour.
The UWP app is a different beastie. The apps themselves still sit on the device, but they are deployed in the context of the user’s first logon. When a user accesses the device for the first time, the available UWP apps from the device are “provisioned” into the user session. The data and settings for these apps are dropped into the local user’s profile rather than stored on the device. Again, here’s a quick grab from the same presentation, this time showing how the UWP app behaves in comparison.
What this does, as many of you may know, is make first logon times very long (which is a nightmare for those with non-persistent VDI or RDSH environments), but also bloats the user profile with what, to be perfectly honest, is a bunch of applications that users rarely, if ever, find any use for. Whilst there may be a lot of plus points to UWP apps around security and portability, most administrators and consultants are just trying to achieve their Windows 10 deployments with a minimum of fuss, rather than reinvent the wheel while they are at it. In my experience, this is where most people are at, and the users – they just want to get on with their work.
So how can we remove the UWP apps from our image? UWP apps are divided into two categories – user (provisioned) apps, which are provisioned to the user from %PROGRAMFILES%\WindowsApps, and system apps, which live in %SYSTEMROOT%\SystemApps.
The first option is to remove the UWP apps from a device (either during the build in Audit Mode, or when the image is already running). Also, as I will mention later, you can remove the apps in supported or unsupported ways.
The second option is to remove the UWP apps from your actual ISO image that you are using for Windows 10 builds and then deploy from there.
Preliminary – decide what you need to keep!
There are some UWP apps that you may need to keep in the image. Microsoft Edge is the first one people think of, but the main one that you probably actually may need is the Windows Calculator, which Microsoft saw fit to make into a UWP app.
So you need to identify the apps (like Calculator) which users may well need and which are now UWP apps. However, many are still optional, like Remote Desktop Connection, which is available in both legacy and UWP versions. We will show you how to remove the apps from a GUI list so it’s a bit easier.
Unfortunately in 1803 quite a lot of UWP apps are “System” apps and can’t be removed. We will attack this in two ways – firstly I will show you how to remove as many as possible without breaking anything, and then I will show you a couple of ways in which you can hack the rest out (but be warned, this is totally unsupported and may well give you issues when applying updates).
Removing the apps on a running (or building) Windows 10 image
I perform these actions before joining the domain, or preferably in Audit Mode, but honestly when this is done doesn’t really make that much difference. The idea is though that whichever machine you perform this on would then become your base (reference) image for deployment.
Now, here is some nifty PowerShell that will allow you to pick which apps you want to remove from a list, by using the little-known (to me anyway) out-gridview cmdlet. Super-cool! Run this command from an elevated PowerShell prompt
Get-AppxProvisionedPackage -online | Out-GridView -PassThru | Remove-AppxProvisionedPackage -online
Hint: you can reduce typing time by using the alias of ogv -p instead of Out-GridView -PassThru
This will give you this output
Now what you need to do is simply highlight the apps you want to remove – remember, we are working on the provisioned apps from the online (current) image, so removing apps here will stop them being deployed to new users. I normally get quite gung-ho here – I tend to leave the Store and Calculator behind as a rule. Not all of the apps you select will be successfully removed, some may be OS-dependent so will fail.
Once you’ve selected what you want to remove, just click OK and it will feed the selected lines back to your PowerShell session.
Occasionally you may get a COM exception error and the process will stop. If this happens, run the command again and remove the packages individually until you find the errant one. In this instance it was the Skype app which was throwing the error, for some reason. In some cases, trying after all the other apps have been removed may get rid of the one throwing the error.
Next I will run the same style of PowerShell for the packages installed for the current user. Not entirely sure this step is required, but I like to be thorough. You will see there are many more app options here!
Get-AppxPackage -AllUsers | Out-GridView -PassThru | Remove-AppxPackage
Again, select what you want to remove and have at it ๐ Be careful though – look at the app Install Location column to get an idea of what you’re removing – removing File Explorer or the .NET framework, for instance, usually isn’t a good idea. I’m going to try and actively leave Edge, Calculator, Cortana, the Lock Screen – as I said previously, know what you’re aiming to achieve!
It’s normal to see errors here – especially if you’re trying to remove stuff like the Mixed Reality Portal (called HolographicFirstRun) which is, for reasons known only to itself and which I alluded to earlier, is tied into the OS directly.
You should see the apps here disappear from your Start Menu and Start Tiles as they are removed.
Realistically, without digging into unsupported areas, this is as much as you can remove. Connect, Cortana, and Mixed Reality Portal are bound to the OS – Calculator and Edge we have elected to leave there.
Now, unless you want the Start Tiles to look all screwy for every user, it’s important to deploy a customized set of Start Tiles that doesn’t include all the stuff we’ve just removed ๐ Firstly, set the tiles up the way you want them to look for new users….
…and then export this basic layout with the following line of PowerShell, which you will need to run elevated. This is assuming you’re not already using a customized Start Layout file in your default profile or GPOs providing the “partial” Start Layouts.
Export-StartLayout -Path c:\users\default\appdata\local\Microsoft\Windows\Shell\LayoutModification.xml
You can also dig even further into the guts of your Windows 10 image by using the PowerShell cmdlet below
Get-WindowsCapability -online | more
and looking at the Capabilities that are showing as Installed. If you want to remove any (you can do this through the GUI as well) you can run the following PowerShell once you have copied the name from the Get-WindowsCapability output
Remove-WindowsCapability -online -name Name-of-application-from-previouscmdlet
Interestingly, you can remove Internet Explorer this way, which is pretty cool if you’re trying to get away from users running this browser.
Now I’m going to log off and log on as a new user, who doesn’t have a profile on the device.
You may have noticed something here – that, namely, we have a few more UWP apps than we were expecting! Mail, Calendar and Skype appear to have resurrected themselves!
What gives?
This is to demonstrate how easy it is, with the odd names of UWP apps, to miss things out. What I have done is failed to successfully get rid of everything I was aiming for. Windows Mail and Calendar both sit under the confusing name of microsoft.windowscommunicationsapps which I did not remove (because it sounded important), so we need at this point to actually revisit our PowerShell and remove a couple more provisioned apps. You will remember Skype gave us the COM exception error when trying to remove it earlier, but when I do it this time, it removes successfully. Not sure why this happened – possibly just an anomalous error. But the lesson is – go back and check before we finish up – you may need to remove more apps here!
Now everything looks pretty much how I want it, so I’m now going to join this machine to the domain which will deploy apps to it (assuming it wasn’t domain-joined already – you don’t need to have it off-domain to do this). And I’m also going to update it at this point with all the latest patches. Additionally, make sure you have defined the Store policies so that the apps don’t try and update themselves (because some of them tend to come back this way!) The policies you are after sit in Computer Config | Administrative Templates | Windows Components | Store
Now we’ve got our machine fully patched, applications deployed, policies active (including a policy that deploys a customized Start Tiles layout and which has a rather glaring mistake in it which you may notice), and all we have on the Start Menu and Start Tiles, UWP-wise, is this.
This is as far as you can go without getting into dodgy territory. Obviously Edge and Calculator can also be removed, but we’ve elected to leave them. Connect and Mixed Reality Portal, though, are tied to the OS and not able to be removed.
What if you really wanted to remove them? There are a couple of, and I need to stress this, probably completely unsupported ways of doing this…
Getting down and dirty and unsupported
The first method that I’ve heard mooted is to disable the App Readiness service via GPO. This service controls the provisioning of the UWP apps to new users. So if you disable it, none of them will be deployed. Sounds good, right?
Here’s what your screen looks like after a new user logs on and the App Readiness service is disabled.
No UWP apps at all – but no Calculator, and more importantly, no Settings app. Oops. Looks like we’ve taken it a bit too far, eh? Is there any way we could load them back in? Could we use PowerShell to just load the apps we want as the user logs in?
Hat tip to Jack Smith over at LiquidWare for pointing me to his script which is hosted here. When a user logs on with App Readiness disabled, we could maybe load the apps we want back in by using this bit of PowerShell? (careful, lines may wrap)
$appxs=”Microsoft.MicrosoftEdge,Microsoft.Windows.ShellExperienceHost,Microsoft.Windows.Cortana,
windows.immersivecontrolpanel,Microsoft.WindowsCalculator”
$appxs=$appxs.Split(“,”)
foreach ($appx in $appxs) {
Get-AppXPackage -AllUsers -name *$appx* | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register “$($_.InstallLocation)\AppXManifest.xml”}
}
However, adding apps needs admin privileges, which frankly I find a bit bizarre. Could we manage this with a Scheduled Task?
Unfortunately no – as we can only run a Scheduled Task as an administrative user, then it loads the apps for the admin user rather than the user we are targeting, which isn’t much use really. What we need is a way to make our logged-on interactive user an elevated admin temporarily, in order for this to work.
If you have them, UEM tools like Ivanti UWM and LiquidWare Labs ProfileUnity allow you to elevate processes such as scripts whilst still keeping the context of the launching user. As I am most familiar with Ivanti products, I’ve used theirs to do this. Now note, I am not using Ivanti’s UWM Environment Manager to run the script as SYSTEM (which is an option), because the LocalSystem account cannot deploy UWP apps. We need to use Ivanti Application Control (formerly Application Manager) to apply a Builtin Elevate to the interactive non-admin account.
To achieve this, first create the script above and save it on the local device as a .ps1 file
Next use Ivanti Application Control to allow the user (in this case we applied it for Everyone) to get the Builtin Elevate on running this script file, which means it runs as an administrator.
Once you’ve got the script ready to run elevated, you just need to trigger it as the user logs on. You could do this through your UEM tool or through standard GPO logon scripts or even a Scheduled Task. This works quite nice and swimmingly , getting rid of all the guff except that which we want ๐
The obvious problem is, of course, that you need a third-party tool like Ivanti or LiquidWare to handle this, which costs money – I did think about using CPAU to achieve it, maybe that’s a challenge for the future. But that’s not the only problem, sadly. Before you do any Windows 10 Cumulative Updates, the App Readiness service needs to be running or it will fail the update. So before updates are deployed, the GPO will need to be temporarily reversed – bit of a pain, although you could probably do something clever with a shutdown script, which turns the service back on as the machine goes down for maintenance and then it gets disabled again at startup, maybe (again, I might revisit this bit later).
So the App Readiness service method is doable, but needs a third-party tool to reinstall the apps and is a pain when it comes to updates ๐ Is there any way to get rid of these unmovable UWP apps out-of-the-box, if you really really wanted to? Well, yes, actually it can be done…but it’s a bit of a hacky mess, to be fair.
First, download psexec from the PSTools suite into your image. Log on as an administrator and fire up an admin command prompt, then run these commands
ren c:\windows\systemapps\Microsoft.Windows.HolographicFirstRun_cw5n1h2txyewy Microsoft.Windows.HolographicFirstRun_cw5n1h2txyewy_BLOCKED
This renames a folder in the SYSTEMAPPS folder, the one that controls Mixed Reality Portal
copy NUL c:\windows\systemapps\Microsoft.Windows.HolographicFirstRun_cw5n1h2txyewy
This will create an empty file with the same name as the folder we have renamed so it can’t come back.
psexec /accepteula -i -s cmd.exe
What this does is launch a command window with SYSTEM privileges. Now run these commands
cd c:\programdata\microsoft\windows\apprepository\packages
ren Microsoft.Windows.HolographicFirstRun_10.0.17134.1_neutral_neutral_cw5n1h2txyewy Microsoft.Windows.HolographicFirstRun_10.0.17134.1_neutral_neutral_cw5n1h2txyewy_XXX
This will rename a set of source folders that seem to be the genesis of the shortcuts in the Start Menu. If you neglect to do this second folder rename (i.e. if you just rename the folder in SYSTEMAPPS and not the one in PROGRAMDATA), you will get a blank icon at the bottom of the Start Menu trying to reference the app.
Now if we log on as another user…that damned MRP is gone ๐
You can repeat this process for the Connect app by identifying it and repeating the same process we have outlined above. The Connect app is titled Microsoft.PPIProjection_cw5n1h2txyewy, so these are the commands you need:-
ren c:\windows\systemapps\Microsoft.PPIProjection_cw5n1h2txyewy Microsoft.PPIProjection_cw5n1h2txyewy_BLOCKED
copy NUL c:\windows\systemapps\Microsoft.PPIProjection_cw5n1h2txyewy
psexec /accepteula -i -s cmd.exe
cd c:\programdata\microsoft\windows\apprepository\packages
ren Microsoft.PPIProjection_10.0.17134.1_neutral_neutral_cw5n1h2txyewy Microsoft.PPIProjection_10.0.17134.1_neutral_neutral_cw5n1h2txyewy_XXX
So with this in hand, we are now down to the maximum possible strimming of UWP apps that can be done (well, unless you want to take out Edge and Calculator too, but we might need those)
Would I use this second method personally, renaming the folders and setting up dummy ones? Well, actually, no I wouldn’t. Much as though I am loth to see useless stuff like the Mixed Reality Portal cluttering up the Start Menu and wasting valuable logon time as it is dumped on there, fiddling with the Windows 10 app folders does give you problems with updates. The latest cumulative update wouldn’t install if I renamed the SYSTEMAPPS folders prior to doing it – I had to rename them back to their original titles and then make the changes again post-update. Hopefully Microsoft might actually deprecate the Mixed Reality Portal and stop shoveling it in our faces.
So for a summary – use the PowerShell I showed to remove as many UWP apps as possible, tidy up the Start Tiles, but don’t get excited and go with the renaming of folders unless you ABSOLUTELY have some reason for getting rid of the extra shortcuts. If you’re using Ivanti or LiquidWare, you can use the documented method for disabling App Readiness and reinstalling apps on the fly – but you need to find a way to deal with the service because it needs to run when you’re doing updates. If you’re erring on the side of caution, currently the best advice is – get rid of as many as possible, but don’t get trigger-happy, unless you want to have lots of fun updating.
Removing UWP apps from the base Windows 10 ISO
This is also something you can do, if you don’t want to go through the rigmarole we’ve just written up. This method removes the UWP apps from the WIM of the ISO file that you’re using to install Windows 10.
I’d love to take credit for this, but I’ve used the script from Andre Picker (which you can download here) to achieve this.
First, make sure you’re going to run it on a machine running the latest version of DISM in order to service the image. For posterity, I did it from a Windows 10 1803 machine as I expect that would have the latest version of DISM ๐
Get your ISO file, and extract it out somewhere so you can work on the WIM files (7-Zip is ideal for this). The script you have downloaded from the link above, make sure this sits in the same folder as the install.wim file. In my case, this is \sources.
Within the script there is a whitelist section which will list the apps that are going to be retained. The default version retains Calculator and the Store. This is the whitelist section from the script:-
$WhiteListedApps = @(
“Microsoft.StorePurchaseApp”
“Microsoft.WindowsCalculator”,
“Microsoft.WindowsStore”
)
If you wanted to add another (e.g. Microsoft.WindowsHelp) you would add it as so
$WhiteListedApps = @(
“Microsoft.StorePurchaseApp”
“Microsoft.WindowsCalculator”,
“Microsoft.WindowsStore”
“Microsoft.WindowsHelp”
)
Next, you need to run the downloaded PowerShell script from an elevated session, which as I said previously needs to sit in the same folder as your install.wim file. The syntax is as below
RemoveApps.ps1 -pathtowim c:\folder\sources\install.wim
This will then run through the apps in the install files and remove the ones you specified, leaving those in the whitelist
Once completed, you simply need to save the modified install files back into an ISO file. I normally do this by using ImgBurn, although if you have other software that can create a bootable ISO that will work fine as well. ImgBurn is quite easy to use, just remember to set the options as shown in the two images below
Once this is done, you can use your new modified ISO image to create a Windows 10 device in the usual fashion, but without the UWP apps you have removed.
As noted previously, though, you need to create a custom Start Tiles layout or your screen will look messy as in the above image.
Summary
The above methods allow you to get rid of as many of the UWP apps as you want. The PowerShell methods will get rid of them as much as possible in a supported fashion, whether this be during optimization during a reference image build or actually within the ISO files you’re using for deployment. The PSTools hacking will allow you to chisel out the ones that are tied inextricably to the OS (at least in this version), but I’d really only use this method in non-persistent VDI environments where machines are regularly refreshed and the update process is done on a single golden image. Otherwise, you may give yourself a large overhead of maintenance.
Combining these processes with my article on creating a custom default user profile in Windows 10, and my set of Windows 10 logon optimizations, should allow you to get your Windows 10 image as streamlined as humanly possible.
thanks
Excellent article!!! I need to know something, is good idea apply this how-to in the mandatory profile creation, in the deploy image, or both? Thanks for your passion
I normally do this in the image as it is device that is key rather than user. I will have an article out soon that deals with mandatory profile creation, which is very similar to dealing with a default profile.
Article on mandatory profile creation is now live
I must be missing something with the Get-AppxProvisionedPackage -online | Out-GridView -PassThru | Remove-AppxProvisionedPackage -online
When i select multiple apps to remove i get
Remove-AppxProvisionedPackage : Unspecified error
When I select one app its fine
Hi Daniel, unfortunately this happens to me occasionally, but if you can find the one app that seems to trigger the error, it usually improves afterwards.
This post is OUTSTANDING!! Amazingly thorough, thank you so much! I’ve been looking for weeks for this kind of information.
While waiting for the re-release of Windows 10 LTSC 2019 (1809) I am under a little time pressure to roll out 80 new computers for the faculty users at my college. I decided it would be responsible of me to once more attempt to “sculpt” Enterprise 1803 into some semblance of actual enterprise-oriented behavior, since I don’t want to go back to LTSB 1607 on the nice new Lenovos. Microsoft was just teasing me with LTSC; a day after we received the new hardware, they pulled the ISO from MVLS. Arrrgggghhhh.
Anyway, the help you’ve provided here is much appreciated, thank you again!
Thanks David, it’s always good to hear of articles helping people out – after all, that’s what they’re for! ๐
Hello James,
Question on the “Removing UWP apps from the base Windows 10 ISO” section … Why is it necessary to return the volume to an ISO file after modifying install.wim?
Because I normally build my machines using the ISO, if you don’t do it like that, then you don’t need to ๐
Yes, I usually start with the ISO from MVLS, which I then use with Rufus (https://rufus.ie/en_IE.html) to create a bootable USB drive. Then I create an autounattend.xml file with SIM to install the OS to a prototype machine with a few key settings.
So, since that bootable USB drive has a writable install.wim in the sources folder, I thought I could just modify that, and tried doing so. Turns out that process didn’t create the reg keys that keep the UWPs from returning ([HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deprovisioned…), whereas the first process with the online OS DID create all those keys.
Great article, this is exactly what I was looking for. Is there a way to install the Microsoft Store but make it hidden so that we can add apps if need be? If we can make it hidden but then run the exe from the location that would be great but still stuck at trying to run that as well. Thank you again for a great tutorial.
This article really helped us in our school, because of the stupid login times on windows 10 for a new user. The issue we are now facing is Windows Updates fail and machines every morning is reverting changes for about 20 minutes due to the failing updates, found out that disabling App Readiness is causing this. Has anyone else come across this and is there a way around this issue? Been looking around now for a few months and still getting nowhere. Thanks
Great article and worked beautifully for my build.
This is awesome. I’ve been beating myself up trying to figure out how to get rid of those persistent apps in 1803 and up. I currently run a powershell script I call from the Unattended file, and it removes all the pesky apps from that account that’s deploying the build, but some of them come back when a new user logs in. It was very frustrating considering it worked great with versions 1703 and below. But the bigger question remains…Why would MS force those apps on you in an Enterprise installation? What employer thinks XBox Live and Candy Crush Soda Saga are good ideas in a corporate environment? So annoying.
Hi, Thanks.
Quick Question, As I saw in your video also, some of the apps are not removed, they just show in start menu but are not listed in GUI from where v can remove it.
You just unpinned them from start. How to make sure that they will not come in new user profile ?
Which apps are you referring to? Not sure I follow
James. Thanks for all your stuff. Your articles have been a big help as I built out my Win10 VDI environment. Have you discovered (or even tried) a way to re-provision a UWP app? Say in your example you inadvertently removed Windows Calculator. Seems like you should be able to Add-AppxProvisionedPackage (there is the cmdlet after all). But I have not been successful with it.
It almost seems you have to reinstall Windows 10 to get them back. But I cannot do that… I am using Citrix App Layering. All App Layers I have built are tied to the specific OS Layer they were built with. New OS means making new App Layers. So I am searching for a way to re-provision a couple of UWP apps. (Specifically, Sticky Notes and OneNote as OneNote from Office is deprecated after Office 2016.)
Have you tried Get-AppXPackage | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register “$($_.InstallLocation)\AppXManifest.xml”}
Note – if you’re pulling out the UWP apps by renaming the folders, note that for the 1903 update, some of the folder names (notably the PPI Projection one) have changed from those in this article.
Thanks for writing the most helpful post on removing appx packages I’ve read thus far.
All the other posts just repeat the same steps of removing appx packages for the current user by manually specifying the appx package id.
Your post lists how to remove both provisioned packages and user packages plus you list a PowerShell Cmdlet to pick and chose things and I didn’t know that existed.
I for the most part stick with the Windows Command Prompt (cmd.exe) with it’s built-in commands and batch files for scripting instead of PowerShell with it’s many Cmdlets and powerful scripting functionaly because I just don’t understand how most of the PowerShell commands and why Cmdlets like move-item behave differently from the move commend in Command Prompt.
I have tried to move folders many times using the move-item cmdlet and got access denied but it worked when I used the move command in Command Prompt so I actually did have NTFS Permissions to move the folder.
The move-items Cmdlet must have another permission system like using the DOS Attributes like Readonly, Hidden and System but that would be stupid be those Attributes mean nothing permission wise, they only exist for compatibility with applications that use those DOS Attributes and for File Explorer to use for it’s own display purposes.
Anyway, I took your PowerShell commands, the -allusers option to the {Get|Remove}-AppxPackage cmdlets that I read in the help for those two cmdlets and remembered that there was a sort cmdlet so I made a PowerShell script out of the resulting commands.
== Script Start ==
; Show Dialog to Remove Windows Appx Provisioned Packages sorted by package name
Get-AppxProvisionedPackage -online | sort | Out-GridView -PassThru | Remove-AppxProvisionedPackage -online
; Show Dialog to Remove Windows Appx Packages for all users sorted by package name
Get-AppxPackage -alluers | sort | Out-GridView -PassThru | Remove-AppxPackage -allusers
; Show Dialog to Remove Windows Appx Packages for current user sorted by package name
Get-AppxPackage | sort | Out-GridView -PassThru | Remove-AppxPackage
== Script End ==
Using this script it is possible to completely remove an installed Appx Package from a Windows Install by removing the provisioned packages, the all user install packages and current user packages.
This is somewhat dangerous though as by doing that, there is no way to get those packages back except though the Windows Store if they are available there.
Huh, after looking online, it appears that I used the wrong comment symbol in my PowerShell Script.
I had only run the commands in PowerShell but I had not yet used my PowerShell Script so I didn’t know there was anything wrong with it.
It seems there is a handy Wikipedia article listing what comment symbol to use in various programming languages at https://en.wikipedia.org/wiki/Comparison_of_programming_languages_(syntax)#Comments.
It seems PowerShell uses “#” for a single comment and “” for a block comment.
Very cool research! In addition to it I can suggest simplify removing Connect and MRP icons from the Start menu as following:
1. Get yourself devxExec.exe
2. Run this bat-file
ren c:\windows\systemapps\Microsoft.Windows.HolographicFirstRun_cw5n1h2txyewy Microsoft.Windows.HolographicFirstRun_cw5n1h2txyewy_BAK1
ren c:\windows\systemapps\Microsoft.PPIProjection_cw5n1h2txyewy Microsoft.PPIProjection_cw5n1h2txyewy_BAK1
copy NUL c:\windows\systemapps\Microsoft.Windows.HolographicFirstRun_cw5n1h2txyewy
copy NUL c:\windows\systemapps\Microsoft.PPIProjection_cw5n1h2txyewy
devxexec /user:SYSTEM “cmd /c ren c:\ProgramData\Microsoft\Windows\AppRepository\Packages\Microsoft.Windows.HolographicFirstRun_10.0.16299.15_neutral_neutral_cw5n1h2txyewy Microsoft.Windows.HolographicFirstRun_10.0.16299.15_neutral_neutral_cw5n1h2txyewy_bak2”
devxexec /user:SYSTEM “cmd /c ren c:\ProgramData\Microsoft\Windows\AppRepository\Packages\Microsoft.PPIProjection_10.0.16299.15_neutral_neutral_cw5n1h2txyewy Microsoft.PPIProjection_10.0.16299.15_neutral_neutral_cw5n1h2txyewy_bak2”
Also I noticed this not simply removes the icons for the new user, but also the existing account gets rid of them on next log in / reboot.
Hi James. Good article.
the LayoutModification.xml is not apply to any user on windows 1809
Any Ideas why ?
Thanks
Nice post, however for me Windows Powershell shows apps that aren’t installed. For example, Get-AppxProvisionedPackage -Online says i have Microsoft.WindowsCamera_2018.826.78.0_neutral_~_8wekyb3d8bbwe but I don’t.
Any safe way to remove these false entries?
There is a difference between what is provisioned (i.e. will be installed to a new user) and what you have installed into your profile. New provisioned apps are sometimes added, obviously the user can uninstall them as well. They should be safe to remove.
Yes, but provisoned apps cannot be removed because the application is not under WindwosApp..
Windows thinks the app is available but it’s not. I checked the registry and the app is listed there, so for some reason the registry contains a stale entry. I tried CCleaner but it does not pick up this error, maybe there’s some other way to. remove it? There are many references in the registry so removing it manually might break Get-AppxProvisionedPackage (I tried).
Just my luck. Running the command Get-AppxProvisionedPackage -online | Out-GridView -PassThru | Remove-AppxProvisionedPackage -online, just doesn’t give me any view like seen in this post.
Please help
What output do you get?
Just doesn’t return anything, although when i try “Get-AppxPackage -AllUsers | Out-GridView -PassThru | Remove-AppxPackage” It does show me the dialogue with list of well, irrelevant apps to remove. I’m in Audit mode. Win 2019, does it mean that the first command doesn’t find any application to remove (Online) and thus produces no value?
Server 2019 doesn’t have any UWP apps, just some system-level ones
Hi James,
Thank you for your guides above, they have been most helpful as I learn how to build a Windows 10 base image for deployment to dissimilar hardware.
I’m currently logging in as the Administrator in Audit Mode on my master machine (I have various clean builds of this backed up using Acronis True Image 2020) and have used the command you specified in PowerShell to remove certain UWP apps that are deployed by default to All Users on a PC rather than just the current user as below:
Get-AppxProvisionedPackage -online | OGV -p | Remove-AppxProvisionedPackage -online
However, I’d like to use a similar command to be able to add an AppX package for All Users on a PC, and seem to be experiencing problems with the ‘Add-ProvisionedAppXPackage’ command; I’m getting an “Error 1168 Element Not Found” error message. The command I’m entering is:
Dism /online /Add-ProvisionedAppXPackage /PackagePath:C:\Support\Microsoft.HEVCVideoExtension_1.0.32762.0_x64__8wekyb3d8bbwe.Appx /SkipLicense
The AppX package I’m using is “HEVC Video Extensions from Device Manufacturer” downloaded from https://www.free-codecs.com/hevc_video_extension_download.htm
As it is, when I install this package by double clicking on it, it installs for the current user but then the machine won’t SysPrep because the AppX package isn’t provisioned for All Users. Please can you help me resolve this issue?
Try and carve this up to suit your needs rather than using DISM – Add-AppxProvisionedPackage -Online -PackagePath “$PSScriptRoot\Microsoft.Office.OneNote_16001.1112 6.20076.0_neutral___8wekyb3d8bbwe.AppxBundle” โLicensePath “$PSScriptRoot\Microsoft.Office.OneNote_8wekyb3d8b bwe_e336bb8f-16ed-7cbe-afee-971dd3041585.xml”
Ah thanks james
Thanks for this. I used it to build an image for my company. But now I have a specific user that needs the Windows Store, which I removed. Is there a way to do this? Thank you.
There is a command to put them all back – something like Get-AppXPackage -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register “$($_.InstallLocation)\AppXManifest.xml”}
Thanks for the quick reply. Unfortunately I had tried this, and although it looked like something was happening, nothing changed. I had removed Store using the interface as shown in this article, thinking that it would not be needed (not to mention our GPO disables it, but I can easily fix that), but there is a user that needs to use some apps. I was hoping there might be an easy method to getting it back, but unless you have another suggestion, I’ll just have to build an image specifically for them.
Hi James, great article. Any tips on removing the UWP shortcuts from the Start menu on existing users who previously had them?
Once they’re provisioned into the user profile they can only be removed by somehow invoking the Remove-AppxPackage command from within the user session.
I’m simply attempting to remove Office files from the WindowsApps folder to free space. I’ve uninstalled Office, and only have a single user (myself), also Administrator. I run Powershell from an elevated prompt and receive the message “The system cannot find the path specified” when selecting any of the Office applications. Other packages are removed properly. Any suggestions would be appreciated.
PS/In researching this yours was the only solution that made use of the gridview. Nice.
An update on the modicum of progress made here. Reviewing the DISM.LOG entries am receiving the error (when selecting to remove only Microsoft Access):
“Msg:[Failed to open ‘C:\Program Files\WindowsApps\Microsoft.Office.Desktop.Access_16051.14026.20308.0_neutral_~_8wekyb3d8bbwe\AppxMetadata\AppxBundleManifest.xml’.]
So the “-online” package name is different than the one residing in my physical “\WindowsApps\” folder, which is:
“\Microsoft.Office.Desktop.Access_16051.14131.20278.0_neutral_~_8wekyb3d8bbwe”
…an older version of Office. Apparently the older version is orphaned on my physical drive. I’ve attempted to manually use Remove-AppxProvisionedPackage with the package name that is physically on the disk and its path, but not successfully. I receive a DISM error “Verify that DISM is installed properly in the image, and then try the operation again.”
Final reply. Deciding these were orphaned folders within \WindowsApps and could not be “properly” removed, decided it would be safe to manually delete. However because of ownership issues this was not exactly straightforward. I had to follow these procedures exactly for each \Microsoft.Office.* folder before I could delete them:
______________________________
Right click on desired folder and choose Properties, click on the Security tab.
Click Advanced under the Security tab.
Click on the “Change” link behind the Owner.
Find Enter the object name to select area in the Select User or Group window.
Type your username and click on the Check Names button on the right side.
Click on the OK button at the bottom right to open Advanced Security Settings window.
Check Replace owner on subcontainers and objects under the Owner.
Click on the OK button to confirm your action to take the ownership of the folder.
The Windows Security window will appear and start the process of Changing ownership of files.
Wait for it to complete.
Secondly:
Click on the Advanced button again under the Security tab.
Click on the Continue button under the Permissions tab in Advanced Security Settings window.
Click on the Add button at the bottom left.
Click Select a principal link in the Permission Entry
Click Advanced and Find Now to select your account.
Click OK to confirm.
Check Full control under Basic permissions.
Click OK at the bottom right.
Check Replace all child object permission entries with inheritable permission entries from this object.
Click on the OK button and wait for the system to apply all the changes successfully.
…. the original post with these instructions (if you’d also like to give its author kudos) is at: https://answers.microsoft.com/en-us/windows/forum/all/how-do-i-delete-my-old-windowsapp-folder/a385448c-35e6-4d7e-988b-36d0051a7722
.
This is by far the worst diagram I’ve ever seen, lol! Love it!
Thanks for the write up, super helpful.
https://i2.wp.com/james-rankin.com/wp-content/uploads/2018/07/legacy.png?w=944&ssl=1
This is great!
The first command string (Remove-AppxProvisionedPackage -online) reminds me of why Windows 10 LTSC is so much nicer and cleaner than the Pro version. On a fresh install of LTSC, this window will be empty unless Windows was allowed to dial out and download drivers from the device manufacturer. Note, this can be stopped by keeping the internet disconnected until a Group Policy can be set that will prevent Updates from downloading drivers.
Instead of having to type out these PowerShell strings, you can right-click the desktop and choose ‘New Shortcut’ and then paste in this string:
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -noexit Get-AppxProvisionedPackage -online | Out-GridView -PassThru | Remove-AppxProvisionedPackage -online
Notes: In the Shortcut’s Properties, you should set it to always Run As Admin. The -noexit switch will keep your PowerShell window open after closing the GridView. You can make separate shortcuts for each of the different command strings listed in this article.
Doing it this way, you can make these shortcuts into little tools that rapidly open your GridView and they should work on the various machines you need to work on.
Oh how nice, it condensed my paragraphs into one block of text.
Hi James, great post as always from you.
Has anything changed in the behaviour of UWP apps between 1803 and 20H2?
I’m running the command:
Get-AppxProvisionedPackage -online | Out-GridView -PassThru | Remove-AppxProvisionedPackage -online
and I get 8 apps on there (some may have been previously removed from the Windows 10 template on the hypervisor). However when I log in with a new user (brand new user profile) and run:
Get-AppxPackage | Out-GridView -PassThru | Remove-AppxPackage
I get a huge list of about 50 apps. Any idea how that can be? My understanding was that the items in the Provisioned command acted like a ‘default user’ list and when a new user profile is created that it installs the items from the Provisioned list into that user profile.
If all these apps are not coming from the provisioned list, then how are they getting there?
Or have I misunderstood?
Thanks