Blog

Windows OS Optimization Essentials Part 2: Microsoft Store

By Jake Norman

September 13, 2021 | min

Operating systems can end up being a lot of work for administrators. Work to configure the image, work to install the applications, and work to provide the best user experience possible. As with any software, what is provided to you is what the developer intended, but not necessarily what you want or need for your end users.

This blog series introduces you to Windows® Operating System (OS) optimizations, starting with version 1903. I will attempt to keep these optimizations as environment agnostic as possible. Hopefully, these optimizations will be just as good to administrators of physical machines as to a virtual environment utilizing Nutanix Frame®, Citrix®, or VMware Horizon® virtual desktop infrastructure.

This series aims to share the seemingly infinite number of ways you can optimize a Windows environment, with something for beginners as well as administrators familiar with optimizations, but are looking to deliver an even better experience within their environment.

Of course, the optimizations provided in this blog series are intended only as a guide. Be sure to test the optimizations described in this series internally before pushing the changes to your production environment.

The previous entry of this series covered Active Setup. We discussed what Active Setup is, how it works, and how to optimize it.

This blog addresses the Microsoft® Store platform: its purpose, how it works, and what can be done with it. This particular area of the OS is continually changing and, as such, will require constant management to optimize in a way that works best for your organization. This blog potentially saves even more headaches than any other blog in this series.

As opposed to other areas of potential optimization within the OS, Microsoft Store items are currently relegated only to Windows 10. While the Windows Server OS utilizes UWP, all the UWP applications that exist in Windows Server OS are necessary and can not be disabled.

Future blogs will discuss, in detail, how to optimize your Windows OS environment through Services and Scheduled Tasks.

What is the Microsoft Store?

The Microsoft Store, previously known as the Windows Store, is a digital distribution platform. While it has varied functionality and uses, such as a unified distribution point for console games and digital videos, the reason it is brought up as an optimization topic is because of Universal Windows Platform Apps, sometimes known as AppX packages.

Universal Windows Platform (UWP) Apps are applications that can be used across multiple compatible Windows devices. Why does this matter to you? Because the UWP installs a large number of applications in the OS, for example, the Windows calculators or drivers. While some of these applications may be wanted or even necessary, some of them are unnecessary, depending on your use case, and can be removed to improve the performance of a login or user session.

How Do UWP Apps Work?

How is this you ask? I take you to the yesteryear of Application Management. Since the early days of PCs, applications gave you two options when they were installed. They could be installed for “this user only” or for “all users”. Applications installed for “this user only” are called Single User Applications (SUAs) and are run in the context of the user account. Applications installed for “all users” are called Multi-User Applications (MUAs) and are run in the context of the system account. End flashback.

This circle continues as with UWP Apps, you get the same scenario, as each application can be developed as a SUA or an MUA. Due to the nature of how SUAs and MUAs work, this blog will only be focusing on Single User Application UWP Apps.

So, how do SUA UWP Apps work?

To answer this, we must go deeper into Installed Apps vs Provisioned Apps. When referring to UWP, Installed Apps are applications that are installed for the current user, generally when users purposefully install them from the Windows Store. Provisioned Apps, on the other hand, lurk on your machine awaiting a new user login. When that new user login happens, they pounce, installing themselves for that user. They then become Installed Apps.

The application installation files exist in two different locations. For Installed Apps, the files exist at %localappdata%\packages, a location that is fully visible to that user. For Provisioned Apps, the files exist at %ProgramFiles%\WindowsApps, a location that is hidden and locked down. When a user logs in, the OS checks to see if any Provisioned Apps exist that are not Installed Apps. If any are found, the Provisioned App installs, becoming an Installed App, at which point the files for the Provisioned App are copied from %ProgramFiles%\WindowsApps to %localappdata%\packages.

I realize all this can be a little confusing. MUA, SUA, UWP, Provisioned, Installed, it can become muddled. A basic breakdown of this workflow is below:

Windows Feature Updates or third-party applications can add UWP Apps to the set of Installed or Provisioned Applications in your machine, causing the need for you to periodically check for new UWP Apps to optimize.

What Does this Mean for Me?

As we saw previously with Active Setup, there are two main scenarios to consider when thinking about optimizing UWP Apps: persistent and non-persistent. A third scenario is non-persistent utilizing a profile management solution, which we will also cover.

A persistent scenario covers physical machines and persistent VDI or DaaS virtual machines. For a persistent scenario, UWP Apps work as described above.

A non-persistent scenario works differently. Since Provisioned Apps install themselves when the OS doesn’t find a corresponding Installed App, and these installations happen prior to the user seeing the desktop, this can cause a first login to take an extremely long time.

A profile management solution provides the ability for user specific settings or files, for example the files on your desktop or changes to the way an application looks or works, to persist between non-persistent sessions. This allows for the “best of both worlds” scenarios of image management via non-persistent with the persistence of profile management for the user experience.

For a non-persistent scenario with a profile management solution enabled, due to the placement of the Installed Apps files, these applications may or may not be captured by the profile management solution, depending on the setup of the solution. This capturing of application data via profile management could potentially be good or bad. On one hand, this scenario works closer to what you would see with a persistent scenario, in that the UWP Apps only need to be installed once. On the other, this capturing of application data can cause profile bloat and unnecessary storage consumption, neither of which is preferred.

How Do I Prevent UWP Apps From Running In My Environment?

One thing to know about removing Provisioned or Installed UWP applications is that order of operations is important for what you see. This blog will walk through the process of removing the unnecessary Provisioned Applications first, then moving onto the Installed Applications. If you start with Installed Applications and then move to Provisioned Applications files, folders or application status may appear different then what you will see below.

So, as broken down in the above diagram, there are two types of UWP applications: Provisioned and Installed. Now, that doesn’t mean that the list of Provisioned vs. Installed will match exactly. Some Installed Applications are necessary for the functionality of the OS and, therefore, can’t be removed, whereas all Provisioned Apps can be removed from the system.

Provisioned UWP Applications

We talked about the application install file locations, but how to view the applications themselves? To do that, from an elevated PowerShell, run the command Get-AppxProvisionedPackage -Online. The output will show you information about each Provisioned Application. Small example shown below:

This command can be piped to show only the information you want. Get-AppxProvisionedPackage -Online | Select PackageName will display only the PackageName field from the above. The below list is from an unoptimized Windows 10 20H2 VM.

That is a huge number of applications that install on a per-user basis potentially with each login of a user. Your job, should you choose to accept it, is to understand these applications and if they are desired or undesired in your environment.

To remove these Provisioned UWP Apps, from an elevated PowerShell, you run the command Remove-AppxProvisionedPackage -Online -PackageName “(PackageName of App)”. For this demonstration we are going to pick on the XboxGameOverlay Provisioned App.

So, what does this command actually do? Well, as you can see below, it is no longer listed as a Provisioned App, meaning the application will no longer be installed upon the logon of a new user.

Before:

After:

Since existing users previously had the Provisioned App installed, that app will continue to be installed for them and must be removed as an Installed App on a per-user basis.

But what about the files? This command, by itself, does not remove the files that exist in the Provisioned location of %ProgramFiles%\WindowsApps, but we will return to this later.

Now, this takes care of the Provisioned Application, but you may be asking, “What about the current user logged into the machine?”. That is a great question! You see, because the Remove-AppxProvisionedPackage PowerShell command is specific to Provisioned UWP Apps, it does not work for matching applications that are Installed UWP Apps.

Installed UWP Applications

So how do you check for and potentially uninstall Installed UWP Apps? To view Installed UWP Applications, the command to run in PowerShell is Get-AppXPackage. Get-AppXPackage will show you all the Installed Applications for the user running PowerShell. In the case that there are multiple users that have profiles on the machine, it is recommended instead to use the -AllUsers switch. This will show the Installed Applications for every user on the machine, although this will return a large list of applications. Your better bet is to run something that returns only the information you need. Get-AppXPackage -AllUsers | Select Name will return all Installed UWP Applications, but only show you the names. The full list of Installed Apps is very long so I will only give you the list of names that contain the word xbox, sorted by the Name field.

Notice above that the Microsoft.XboxGameOverlay Installed Application still exists, despite the fact that we removed the Provisioned Application.

To uninstall Installed Apps, the output of the Get-AppXPackage -Name “(Name of App)” -All Users command must be piped to the Remove-AppXPackage command. As such, Get-AppXPackage -Name “(Name of App)” -AllUsers | Remove-AppxPackage is the proper PowerShell command. Continuing from above, we would use the above command to remove the Microsoft.XboxGameOverlay Installed App.

This command will, unfortunately, not provide a visible command output stating the application has been uninstalled. If you are watching closely you might see a progress bar show up, but it’s very quick, as the uninstallation of a single UWP app doesn’t take long. Example shown below.

Now, browsing to %ProgramFiles%\WindowsApps, we will notice that the Provisioned Application files have now been removed by the OS.

Before:

After:

This means that Provisioned Application installation files are only deleted after both the Provisioned App and the Installed App for all users are removed. On the other hand, the Installed Application files located at %localappdata%\packages still exist. Unlike Provisioned Application files, these files are not removed by the OS and have to be manually deleted.

Now, what about the aforementioned Installed Apps that are not Provisioned Apps? As stated previously, the list of Installed Apps is even larger than the Provisioned Apps list. See a sample below:

That is about half the list on an unoptimized machine. So, what do we do with these applications? Even more than the Provisioned Apps, it is imperative that you vet these applications carefully. As stated previously, Installed Apps can sometimes be necessary for the OS to function. If you do choose to delete them, then use the Remove-AppxPackage PowerShell cmdlet

What Are The Potential Downsides To Removing UWP Applications?

The biggest issue you will see with removing UWP Applications is the scenario where you must reinstall those same UWP Applications. This can be done via the Add-AppxProvisionedPackage PowerShell command, but this blog will not cover that process.

While the main Microsoft Store, called Microsoft.WindowsStore in PowerShell, can be removed as both a Provisioned and Installed App, getting it back is extremely difficult. At that point it is usually easier to rebuild your image or restore a backup. With this knowledge in hand, while you may see sites tell you to run the PowerShell command Get-AppxProvisionedPackage -Online | Remove-AppxProvisionedPackage -Online to remove all Provisioned Applications, I do not recommend it for that simple fact.

Along those same lines, some websites will tell you to remove Installed Apps in a similar method. Get-AppxPackage -AllUsers | Remove-AppxPackage will attempt to remove all Installed Apps. Unlike Provisioned Apps, this command will return quite a few non-terminating errors as you attempt to remove Installed Apps that are necessary to the functionality of the OS. But also as with Provisioned Apps, reinstalling applications can be tedious.

In addition, if any custom-built or third party UWP applications (either Provisioned or Installed) are used in your environment, the commands above will remove these as well. Please vet your UWP Applications carefully!

What UWP Applications May be Beneficial to Remove?

Now, to the section everybody came here to read! Below is my list of standard Windows 10 Provisioned and Installed Applications that are beneficial to remove in most environments. As always, please vet these applications for your environment before removing them.

  • Microsoft.BingWeather
  • Microsoft.DesktopAppInstaller
  • Microsoft.GetHelp
  • Microsoft.Getstarted
  • Microsoft.HEIFImageExtension
  • Microsoft.Microsoft3DViewer
  • Microsoft.MicrosoftOfficeHub
  • Microsoft.MicrosoftSoltaireCollection
  • Microsoft.MicrosoftStickyNotes
  • Microsoft.MixedReality.Portal
  • Microsoft.MSPaint
  • Microsoft.Office.OneNote
  • Microsoft.People
  • Microsoft.ScreenSketch
  • Microsoft.SkypeApp
  • Microsoft.StorePurchaseApp
  • Microsoft.Wallet
  • Microsoft.WebMediaExtensions
  • Microsoft.WebpImageExtension
  • Microsoft.WindowsAlarms
  • Microsoft.WindowsCamera
  • Microsoft.windowscommunicationapps
  • Microsoft.WindowsFeedbackHub
  • Microsoft.WindowsMaps
  • Microsoft.SoundRecorder
  • Microsoft.Xbox.TCUI
  • Microsoft.XboxApp
  • Microsoft.XboxGameOverlay
  • Microsoft.XboxGamingOverlay
  • Microsoft.XboxIdentityProvider
  • Microsoft.SpeechToTextOverlay
  • Microsoft.YourPhone
  • Microsoft.ZuneMusic
  • Microsoft.ZuneVideo

Additional Tips

You can obviously script out the entire process to remove these UWP Apps on a line-by-line basis, but why do that? Using an Array as part of your PowerShell command will allow a repeatable process where you can remove all the UWP Apps you want in a controlled method.

Setup:

$packages = @(
“App1”,
“App2”,
“etc.”
)

Example:

$packages = @(
“Microsoft.MicrosoftSoltaireCollection”,
“Microsoft.Wallet”,
“etc.”
)

Provisioned Apps Command:

ForEach ($package in $packages) {
Get-AppxProvisionedPackage -Online |
where DisplayName -EQ $package |
Remove-AppxProvisionedPackage -Online
}

Installed Apps Command:

ForEach ($package in $packages) {
Get-AppxPackage -Name $package -AllUsers |
Remove-AppxPackage
}

And my favorite! If you wish to choose which applications you want from a graphical list, that is achievable as well!

Use the command Get-AppxProvisionedPackage -Online | Out-GridView -PassThru | Remove-AppxProvisionedPackage -Online for Provisioned Packages.

Use the command Get-AppxPackage -AllUsers | Out-GridView -PassThru | Remove-AppxPackage for Installed Packages.

These will each bring up a multi-selectable (CTRL+Click) graphical interface that, once the OK button is clicked, will remove those applications for you.

What’s Next?

This post covers the Microsoft Store as it relates to Operating System optimization, but the Microsoft Store can be used by any developer as part of their application deployment. Consequently, we recommend checking all Provisioned and Installed Apps, either periodically or after each application installation, to verify new entries have or have not been added. If they have, vet them for purpose, and then remove or keep them as needed.

The next blog post will discuss Services and Scheduled Tasks. While diverse, these topics can greatly impact your experience, and should be considered for any optimization task. If you need assistance in optimizing your VDI or DaaS images, check out our Xpert Services Template Image Creation and Optimization service.

Jake Norman is a Senior Consultant with Nutanix Professional Services. He has been a part of the Professional Services team for almost 2 years and prior to that spent 15+ years in a myriad of different environments focusing on EUC and UX work.

© 2021 Nutanix, Inc. All rights reserved. Nutanix, the Nutanix logo and all Nutanix product, feature and service names mentioned herein are registered trademarks or trademarks of Nutanix, Inc. in the United States and other countries. Other brand names mentioned herein are for identification purposes only and may be the trademarks of their respective holder(s). This post may contain links to external websites that are not part of Nutanix.com. Nutanix does not control these sites and disclaims all responsibility for the content or accuracy of any external site. Our decision to link to an external site should not be considered an endorsement of any content on such a site. Certain information contained in this post may relate to or be based on studies, publications, surveys and other data obtained from third-party sources and our own internal estimates and research. While we believe these third-party studies, publications, surveys and other data are reliable as of the date of this post, they have not independently verified, and we make no representation as to the adequacy, fairness, accuracy, or completeness of any information obtained from third-party sources.

This post may contain express and implied forward-looking statements, which are not historical facts and are instead based on our current expectations, estimates and beliefs. The accuracy of such statements involves risks and uncertainties and depends upon future events, including those that may be beyond our control, and actual results may differ materially and adversely from those anticipated or implied by such statements. Any forward-looking statements included herein speak only as of the date hereof and, except as required by law, we assume no obligation to update or otherwise revise any of such forward-looking statements to reflect subsequent events or circumstances.