Blog

Windows OS Optimization Essentials Part 2: Microsoft Store

Jake Norman and Damian Gentile

July 15, 2021 | min

Operating systems can end up being a lot of work for administrators. They need to work to configure the image, install the applications, and 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 Microsoft 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 VDI solutions.

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 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: 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 the way you desire. This blog potentially saves even more headaches than any other blog in this series.

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

Microsoft Store

What is the Microsoft Store?

The Microsoft Store™ , previously known as the Windows Store, is a digital distribution platform. While it has a lot of functionality and uses, such as a unified distribution point for console games and digital videos, the reason it is brought up as an optimization point 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 a multitude of UWP Apps, including calculator and certain drivers, are installed in Windows 10, by default using the Microsoft Store. While some of these applications are usually wanted or even necessary, some of them are unnecessary, depending on your use case, and can be removed to improve the performance of a session or login.

How do UWP Apps work?

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 run in the context of the user account. Applications installed for “all users” are called Multi-User Applications (MUAs) and run in the context of the system account.

With UWP Apps, you get a little bit of a hybrid. Each application can be developed as a SUA or a MUA. However, if it is developed as an SUA, it can be installed for every user that logs into the machine. This means that every new user that logs in to a machine has the potential to have these UWP apps installed in their profile at some point or another, whether or not you want them or need them.

For the purposes of this blog, we will be focusing on Single User Application UWP Apps only.

How does this work and how can you tell which UWP Apps can be optimized?

I realize all this can be a little confusing. MUA, SUA, UWP, provisioned, installed, it can become muddled. A basic breakdown of these terms are below.

Windows Feature Updates or third-party applications will sometimes add UWP Apps to the set of installed or provisioned applications in your machine, causing the need for you to check periodically for new apps to optimize.

What does this mean for me?

As we saw previously with Active Setup, there are two scenarios to consider when thinking about optimizing Microsoft Store applications: persistent and non-persistent machines.

Persistent machines contain both a physical endpoint scenario and a persistent VDI/DaaS scenario. These scenarios consist of a one user to one Virtual Machine (VM) usage scenario and the users’ profile grows over time with applications and user data. For a persistent machine scenario, UWP Apps work as described in the section above.

A non-persistent scenario works differently as SUAs, being provisioned but not installed for each user, install themselves when a new user logs in. Since this installation happens prior to the user seeing the desktop, this installation can cause a first login to take an extremely long time.

For those without a Profile Management solution, this means every login will be long as the OS will always install those applications. For those with a Profile Management solution, when a user logs in the application files are installed to %localappdata$\Packages. These files are visible and accessible. Because of their placement, these files may be captured by a profile management solution, preventing the first user login scenario we see without a profile management solution, but providing profile bloat and storage consumption for applications that may not ever be used. Neither of these scenarios is generally preferred.

How do I prevent UWP Apps from running in my environment?

For SUA Apps, the installation files exist in two different locations. The first is %ProgramFiles%\WindowsApps. This location is where the files are installed from when a new user logs in. This WindowsApps folder is locked down and hidden. The second is %localappdata%\packages. This location is where the files are installed to when a new user logs in. This location is visible and accessible.

Provisioned UWP SUA Applications

Provisioned SUA Applications are visible via PowerShell. From an elevated PowerShell, simply 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 for each login of the user. Your job, should you choose to accept it, is to understand these applications and if they are desired or undesired in your environment.

Now, to remove these provisioned UWP apps, we use a slightly different command. Again, 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, in that hidden and inaccessible folder %ProgramFiles%\WindowsApps that was referenced earlier, the folders that existed for the UWP application are removed.

Before:

 

After:

Now what about the application itself? Well, as you can see, it is no longer listed as a provisioned app as well.

Before:

After:

You may be asking, “But what about the current user logged into the machine?”. That is a great question! You see, while the Remove-AppxProvisionedPackage PowerShell command is specific to provisioned UWP apps, it also works for matching applications that are installed UWP apps. Although it will not remove the files from %localappdata%\packages, it will remove the matching line item from the list of Installed Applications.

Installed UWP Applications

To view installed UWP applications, the command to run in PowerShell is Get-AppXPackage -AllUsers, although this will return a HUGE number of applications. Your better bet is to run something that returns only the information you need. Get-AppXPackage -All Users | Select Name will return all installed UWP applications, but only show you the names. It is even larger than the list of provisioned apps so I will only give you the list of names that contain the word xbox.

So, as you can see below, running the Remove-AppxProvisionedPackage -Online -PackageName “(PackageName)” will remove the installed application as well.

The corresponding folder for the Installed Apps located at %localappdata%\packages can now safely be deleted via File Explorer.

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. A sample below.

That is about half the list on an unoptimized machine. So, what do we do with these applications?

Well, even more than the Provisioned Apps, it is imperative that you vet these applications carefully. Unlike provisioned apps (other than the Microsoft Store itself), installed apps can sometimes be necessary for the OS to function.

For installed apps, the methodology to remove is similar to provisioned apps, with some caveats. Unlike the provisioned apps, the command to remove installed apps must be piped to complete as we need. As such Get-AppxPackage -Name “(Name of App)” -AllUsers | Remove-AppxPackage is the proper PowerShell command. This time I think I will pick on the WindowsMaps 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.

As with the Remove-AppxProvisionedPackage command, this command will not remove the files located at %localappdata%\packages, but they can be removed manually after the command has been run.

What are the potential downsides to removing UWP Applications?

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

While the Microsoft Store (called the Windows Store via the PowerShell command output) can be removed as both a provisioned and installed app, getting it back is extremely difficult. It is usually easier, at that point, to rebuild your image. As such, while you will see multiple places tell you to run the PowerShell command Get-AppxProvisionedPackage -Online | Remove-AppsxProvisionedPackage -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 errors as you attempt to remove installed apps that are necessary to the functionality of the OS. But also as with provisioned apps, reinstalling needed applications can be tedious.

In addition, if any custom-built UWP applications (either provisioned or installed) are used in your environment, you will remove these as well through the above command. Please vet your UWP applications carefully!

What to optimize and what not to optimize in the Microsoft Store

Now, to the section everybody came here to read! Below is my list of provisioned and installed applications that are safe and potentially 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.Microsoft3DViewer
  • Microsoft.MicrosoftOfficeHub
  • Microsoft.MicrosoftSoltaireCollection *Say it ain’t so!
  • Microsoft.MicrosoftStickyNotes
  • Microsoft.MixedReality.Portal
  • Microsoft.MSPaint
  • Microsoft.Office.OneNote
  • Microsoft.People
  • Microsoft.ScreenSketch
  • Microsoft.SkypeApp
  • Microsoft.StorePurchaseApp
  • Microsoft.Wallet
  • 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

The last two might make Peter Quill cry.

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:

Get-ProvisionedAppXPackage -Online|Select DisplayName

$packages = @(

“App1”

“App2”

“etc.”

Installed Apps Implementation:

ForEach ($packages in $packages) {

Get-AppxPackage -Name $packages -AllUsers |

Remove-AppxPackage

}

Under provisioned Apps Implementation:

ForEach ($packages in $packages) {

Get-AppxProvisionedPackage -Online |

where DisplayName -EQ $packages |

}

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.

 

Last minute notes

One thing to mention regarding the removal of UWP applications is the Start Menu. Microsoft has added numerous UWP applications to the Windows 10 Start Menu. Removing these applications does not, unfortunately, remove the icon from the Start Menu. Some of the icons have a right click contextual menu which includes an Uninstall option, but this option won’t remove the icon either.

In addition, if you only remove the installed package, clicking the icon for the matching application on the Start Menu will reinstall the UWP application from the provisioned packages. If you remove the provisioned package and click on the matching application icon, you will be brought out to the Microsoft Store showing “Download and Updates”.

I have not yet found a way to manually or programmatically remove UWP application icons from the Start Menu.

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. 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.