top of page

How to Uninstall macOS Applications using Intune

  • Writer: Gareth Oxendine
    Gareth Oxendine
  • Sep 3, 2024
  • 3 min read

Updated: May 15

ree

Introduction

Using Intune's variety of tools, you can uninstall almost any macOS application regardless of whether it was originally installed with Intune. This article reveals a couple of options for uninstalling applications on macOS devices.



Table of Contents



Uninstallation Options

TIP:

Always consult the application vendor's documentation first. They may provide the exact steps for a proper and complete application uninstallation.

Option 1: Use Intune's Uninstall feature (only for Line of Business apps)

This option is only available if the app was originally deployed with Intune, using the "line of business" app deployment method. In addition, this will only be available if you originally selected yes for the install as managed option.


Editing the assignment for a macOS line of business application in Intune.
  1. Launch the Intune portal, select Apps in the left-hand menu blade, and then select macOS.

  2. Select the application you wish to uninstall.

  3. Select Properties in the middle menu pane and select Edit next to the Assignments header.

  4. Under the Uninstall header, add the appropriate user/device group or select all devices (you may need to first remove the same user/group assignment from under the Install header).


Option 2: Use a Script

Remember you can use Intune to deploy Bash or Shell scripts to macOS devices. Using a script, you can uninstall applications regardless if they were deployed with Intune or not.


Option 2a: Execute the Vendor-Provided Uninstallation Script

Some application vendors provide an uninstallation script already written for us. All we have to do is write a script that executes/runs the vendor-provided script!


Step 1: Locate the Vendor-Provided Uninstallation Script

First, we must see if the vendor provided such a script within the application's files. There are a few locations we can search. The first location listed below should be the first place to check; I've added some example screenshots. The second and third locations listed below the screenshots can also be checked if the first location does not have the script.


  • /Applications/app_name/Contents/Resources/

Show the package contents of an app in macOS using Finder.
Finding the uninstall script for an application in macOS.

  • /Library/Application\ Support/app_name/

  • ~/Library/Application\ Support/app_name/


Step 2: Write the Script for Intune

If we can find an uninstallation script, then we can create a bash or shell script similar to the one below that will execute the script. Replace folderpath and filename.sh with the correct folder path and uninstallation script name respectively.

Step 3: Upload the Script to Intune & Deploy It

Lastly, we'll want to upload and deploy the script we created. Click the link below to learn how to deploy scripts using Intune.

IMPORTANT:

Run the script with elevated permissions by running it as the root user. To run the script as the root user, ensure the Run script as signed-in user setting is set to No.


Option 2b: Create a Custom Uninstallation Script

This option should be your last resort as it is the most work to create and may not be as accurate.


Step 1: Find the Location of the App File and its Dependent Folders/Files
  1. Check for the application file within the /Applications folder.

  2. Check for any dependent folders/files in the locations listed below (you can normally identify which folders/files are associated with the app you are deleting by looking at the name).

    1. /Library/Application\ Support/

    2. /Library/Caches/

    3. /Library/Logs/

    4. /Library/Preferences/

    5. ~/Library/Application\ Support/

    6. ~/Library/Caches/

    7. ~/Library/Logs/

    8. ~/Library/Caches/


Step 2: Create the Script

Once you've found the location of the Application and its dependent folders and files, create a script that manually deletes these files. Below is an example script; edit it, replace the file paths, and add or remove as needed.

Step 3: Upload the Script to Intune & Deploy It

Lastly, we'll want to upload and deploy the script we created. Click the link below to learn how to deploy scripts using Intune.

IMPORTANT:

Run the script with elevated permissions by running it as the root user. To run the script as the root user, ensure the Run script as signed-in user setting is set to No.




Cover Image provided by Freepik

Never Miss a Post. Subscribe Now!

Want to be notified whenever a new article is posted? Enter your email address and subscribe!

Thanks for submitting!

© 2024 by DMTT. Powered and secured by Wix

bottom of page