Modern Workplace Brewer, MVP & MCT

In the past year, I worked at a customer, who ordered around 4000 HP laptops to distribute it to their end-users. But something was wrong in the order because they asked for the Windows 10 Signature Edition, but they got the normal Windows 10 Pro edition.


But first, what is a Windows 10 Signature Edition?

A typical boxed computer purchased from a retailer includes crapware, spyware, toolbars, antivirus programs, games, and other undesirable programs that assume a large amount of space on your hard drive. These programs may send out pop-up messages at regular intervals, asking the user to subscribe or purchase the premium version.
In the worst-case scenario, the hidden programs that operate in the background can cause your PC to slow down. Manufacturers earn more money by installing trial versions of games and other unwanted trialware on new PCs, which is why they come bundled with the garbage apps.
By delivering clean, fast, and efficient PCs, Microsoft Signature Editions aim to alleviate the suffering of crapware. No additional software is included with computers that ship with Windows 10 Signature Edition. This means you will receive the full Windows 10 experience.


Back to reality

So, we did not receive the Signature Edition, so we had to create a solution to remove all the Windows 10 bloatware. There are plenty of solutions on the internet, for example, if you want to remove the built-in apps, like the Xbox apps, you can “buy” the Xbox app in the Microsoft Store for Business and sync that to Microsoft Intune. After that you can assign this app as uninstall for your computers. But with this solution you got a lot of “pollution” in your Intune tenant. And… what about to remove the HP bloatware, in this case, as well from all the devices?


The solution

After several hours of searching on the internet, I found a script from mark05E on his GitHub. His script is to remove HP bloatware, but we can edit this script to remove Windows 10 bloatware as well. So, we have work to do to edit this script for the built-in apps.


The script

I copied and edited the script a little, so I can use it in Intune.

I added a few lines to create a log file (RemoveW10Bloatware.log) and I added a tag file (RemoveW10Bloatware.ps1.tag) for detection, if you gonna deploy it with Microsoft Intune.

# Create a tag file just so Intune knows this was installed
if (-not (Test-Path "$($env:ProgramData)\Microsoft\RemoveW10Bloatware"))
{
    Mkdir "$($env:ProgramData)\Microsoft\RemoveW10Bloatware"
}
Set-Content -Path "$($env:ProgramData)\Microsoft\RemoveW10Bloatware\RemoveW10Bloatware.ps1.tag" -Value "Installed"

# Start logging
Start-Transcript "$($env:ProgramData)\Microsoft\RemoveW10Bloatware\RemoveW10Bloatware.log"

The next section is where you fill in the Windows 10 built-in apps that you want to remove during the deployment. You can add or remove apps according to your needs.

To retrieve a list of the Appx packages, which are installed in Windows 10, you need to open a Powershell window as Administrator and type the following cmdlet:
Get-AppxPackage -AllUsers | Sort-Object Name | Select-Object Name -Unique.

The output should be like the following screenshot:

Figure 01 - Get-AppxPackage output
# List of built-in apps to remove
$UninstallPackages = @(
    "Microsoft.Getstarted"
    "Microsoft.GetHelp"
    "Microsoft.Getstarted"
    "Microsoft.Microsoft3DViewer"
    "Microsoft.MicrosoftOfficeHub"
    "Microsoft.MicrosoftSolitaireCollection"
    "Microsoft.MixedReality.Portal"
    "Microsoft.Office.OneNote"
    "Microsoft.OneConnect"
    "Microsoft.MicrosoftOfficeHub"
    "Microsoft.SkypeApp"
    "Microsoft.WindowsFeedbackHub"
    "Microsoft.Xbox.TCUI"
    "Microsoft.XboxApp"
    "Microsoft.XboxGameOverlay"
    "Microsoft.XboxGamingOverlay"
    "Microsoft.XboxIdentityProvider"
    "Microsoft.XboxSpeechToTextOverlay"
    "Microsoft.YourPhone"
    "Microsoft.ZuneMusic"
    "Microsoft.ZuneVideo"
)

You could add some installed programs to this script as well. But that I will so you in the customized HP bloatware remover script in another blog post.

# List of programs to uninstall
$UninstallPrograms = @(
)

The next part of the script is.... well... the necessary powershell cmdlets to execute the script to remove all the built-in apps that you added to the list.

$InstalledPackages = Get-AppxPackage -AllUsers | Where {($UninstallPackages -contains $_.Name)}

$ProvisionedPackages = Get-AppxProvisionedPackage -Online | Where {($UninstallPackages -contains $_.DisplayName)}

$InstalledPrograms = Get-Package | Where {$UninstallPrograms -contains $_.Name}

# Remove provisioned packages first
ForEach ($ProvPackage in $ProvisionedPackages) {

    Write-Host -Object "Attempting to remove provisioned package: [$($ProvPackage.DisplayName)]..."

    Try {
        $Null = Remove-AppxProvisionedPackage -PackageName $ProvPackage.PackageName -Online -ErrorAction Stop
        Write-Host -Object "Successfully removed provisioned package: [$($ProvPackage.DisplayName)]"
    }
    Catch {Write-Warning -Message "Failed to remove provisioned package: [$($ProvPackage.DisplayName)]"}
}

# Remove appx packages
ForEach ($AppxPackage in $InstalledPackages) {
                                            
    Write-Host -Object "Attempting to remove Appx package: [$($AppxPackage.Name)]..."

    Try {
        $Null = Remove-AppxPackage -Package $AppxPackage.PackageFullName -AllUsers -ErrorAction Stop
        Write-Host -Object "Successfully removed Appx package: [$($AppxPackage.Name)]"
    }
    Catch {Write-Warning -Message "Failed to remove Appx package: [$($AppxPackage.Name)]"}
}

# Remove installed programs
$InstalledPrograms | ForEach {

    Write-Host -Object "Attempting to uninstall: [$($_.Name)]..."

    Try {
        $Null = $_ | Uninstall-Package -AllVersions -Force -ErrorAction Stop
        Write-Host -Object "Successfully uninstalled: [$($_.Name)]"
    }
    Catch {Write-Warning -Message "Failed to uninstall: [$($_.Name)]"}
}

Stop-Transcript

That is the script, folks.

Now we need to deploy it via Microsoft Intune. In my GitHub repository, you will find an intunewin file as well. You can download it, if you are satisfied with the removal of the earlier mentioned built-in apps. 😁
If not, then you need to edit the script and wrap it to an intunewin file. But I think that you know how to do that.


Time to deploy it

  1. Go to the Enpoint Manager portal
  2. Go to Apps -> Windows and click on + Add
  3. In the dropdown list, select Windows app (Win32)
  4. Click on Select
  5. Click on Select app package file
  6. Browse to the intunewin file, that you created or downloaded from my GitHub
  7. Click on OK
  8. Fill in a Name, Description and the Publisher. If you want you can fill in the rest of the fields as well
Figure 02 - App information
  1. Click on Next
  2. At the Install command field, type this:
    powershell.exe -noprofile -executionpolicy bypass -file .\RemoveW10Bloatware.ps1
  3. At the Uninstall command field, type this:
    cmd.exe /c del %ProgramData%\Microsoft\RemoveW10Bloatware\RemoveW10Bloatware.ps1.tag
  4. Leave the rest as default
Figure 03 - Progam
  1. Click on Next
  2. Choose at the Operating System architecture for 64-bit
  3. Choose at the Minimum operating system a value that suits your environment
Figure 04 - Requirements
  1. Click on Next
  2. From the Rules format dropdown, select Manually configure detection rules
  3. Click on + Add
  4. At the Rule type dropdown, select File
  5. In the Path field, type %ProgramData%\Microsoft\RemoveW10Bloatware
  6. In the File or folder field, type RemoveW10Bloatware.ps1.tag
  7. From the Detection method dropdown, select File or folder exist
  8. Click on OK
Figure 05 - Detection rules
  1. Click on Next
  2. Click on Next
  3. Click on Next
  4. On the Assignments tab, choose an Azure AD group with your devices and select them as required. I set the End user notifications to Hide all toast notifications, so that the end user is not bothered with the notification
Figure 06 - Assignments
  1. Click on Next
  2. Review your settings and click on Create

And now we have to wait for the program has been arrived on your targeted systems. A few minutes later, after the script has done his work, you will see that the apps, mentioned in the script, are removed from your Windows 10 device.

Thanks for reading this post. The next one will be about removing HP bloatware.

You’ve successfully subscribed to Jeroen Burgerhout
Welcome back! You’ve successfully signed in.
Great! You’ve successfully signed up.
Success! Your email is updated.
Your link has expired
Success! Check your email for magic link to sign-in.