The Microsoft Store for Business will be discontinued mid 2023 and Intune recently introduced the new Windows Store experience backed by winget to distribute apps to your Intune managed endpoints.

To simplify the migration to the new Windows Store experience I created a PowerShell Script that migrates all currently assigned Windows Store for Business apps to the new Windows Store experience.

Kudos to Sander Rozemuller for providing detailed instructions about creating winget apps as PowerShell code samples.

Challenges

While scripting and extracting the existing Windows Store for Business (WSfB) apps I encountered the following issues:

  • Not all apps in WSfB have valid privacy and information URLs, therefore I added a check whether the URL starts with http(s).
  • Some apps have characters present (äöüë….) that require UTF-8 encoding. So I explicitly set the HTTP content-type header to UTF8.

Script prerequisites

To run the script you need to have the Microsoft Graph PowerShell SDK modules installed on your machine. You can install them with the following command:

1
Install-Module Microsoft.Graph.Authentication, Microsoft.Graph.Devices.CorporateManagement -Scope CurrentUser

From a permissions perspective you need an Azure AD Application Administrator for the initial OAuth permission consent and for regular execution the Intune Administrator role.

The script

The script performs the following high-level steps:

  • Fetch all assigned Windows Store for Business apps
  • Extract the app package identifier
  • Filter out existing winget apps (only apps not yet present will be imported as winget apps)
  • Search the Windows Store for package information
  • Fetch package information (description, publisher, image)
  • Creating the winget app

After running the script you will see the app type displayed as: Microsoft Store app (new):

Migrated Apps

Now it’s time to assign the apps to a test group to verify the deployment and once you’re confident you can complete the migration by changing the assignments.

Should you decide during testing that you want to get rid off the newly imported apps and start over you can remove all winget apps with the following command:

1
Get-MgDeviceAppMgtMobileApp -Filter "isOf('microsoft.graph.winGetApp')" -All | ForEach-Object { Remove-MgDeviceAppMgtMobileApp -MobileAppId $_.Id }

Happy winget testing 🎁.