Uninstall any application in a jiffy using PowerShell and Microsoft Intune

Introduction

This post is a just a quick follow up on my previous post: Uninstall any application in a jiffy using PowerShell and Configuration Manager

I received a few questions whether the PowerShell script can be used with Microsoft Intune instead of Microsoft Configuration Manager. And sure! This post will explain one of many approaches available with Intune. ๐Ÿ™‚

PowerShell

The script I use is located on my GitHub repository here: PowerShell/Uninstall-Application.ps1 at master ยท imabdk/PowerShell (github.com)

Now, the script is originally designed to accept and require a parameter: -displayName.

If you want to use this with the script feature in Intune, you’ll have to make one adjustment: Define the parameter within the script and make it non-mandatory like this:

param(
    [Parameter(Mandatory=$false)]
    [string[]]$displayName = ("KeePass","FileZilla")
)

Microsoft Intune

In the Microsoft Intune admin center, navigate to Devices -> Scripts and create a new script for Windows 10 and later:

Configure the script settings similar to below and deploy to the desired group of devices or users.

Monitor C:\ProgramData\Microsoft\IntuneManagementExtension\Logs\AgentExecutor.log for details on execution of the script:

ENJOY ๐Ÿ™‚

3 thoughts on “Uninstall any application in a jiffy using PowerShell and Microsoft Intune”

    • What details are being written to the PowerShell console when the script is run manually? Is it because the uninstall string doesn’t exist or because 7-zip was installed via some odd installer? ๐Ÿ™‚

      Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.