Posted on 08-30-2021 01:24 PM
Occasionally I'll run into users who have installed Garageband, Pages, Numbers and Keynote or they'll end up being preinstalled on a new Mac (less common now) and I was wondering if anyone has ever created a policy to uninstall or remove these from an end user's device.
If so any chance they'd be willing to share a script or policy?
I thought about doing this as a policy but all the instructions I've found seem to require a .pkg to be referenced which I don't have for any of these apps.
Thanks for any suggestions.
Posted on 08-30-2021 01:43 PM
@MBlank For Keynote, Number, or Pages a simple /bin/rm -rf on the application bundle will do the trick, e.g.:
/bin/rm -rf /Applications/Keynote.app
GarageBand is more problematic as it will install a variable amount of media files. If you search Jamf Nation for articles on how to pre-install the Garageband media files it'll give you a good idea of what you'll need to remove.
You might also want to check and see if your users are actually using any of those apps before removing them, and here's an example EA to determine the last time GarageBand was launched:
#!/bin/sh
AppToCheck="/Applications/GarageBand.app"
result="2000-01-01 00:00:01"
if [ -d "${AppToCheck}" ]; then
result=$(mdls -name kMDItemLastUsedDate "${AppToCheck}" | cut -f 3,4 -d \ )
fi
echo "<result>$result</result>"
Configure that EA as a Script Input Type returning Date Data Type and you can use it in a Smart Group to determine if the app has been launched recently.
Posted on 08-30-2021 02:18 PM
Thanks. Should each "rm" command be attached to a separate policy? Can they all be bundled together in one policy or script?
Posted on 08-30-2021 06:18 PM
@MBlank If you're going to check to see if the apps have been used it'd be easier to have a separate policy to remove each app. If you're just looking to nuke all 4 with no check for them having been used, do it with a single policy.
Posted on 08-31-2021 01:21 AM
yeah, a side task i have is to get a script to remove Garageband as it just takes up space on a corporate device that we don't even allow it to be launched... following with interest..
Posted on 08-31-2021 04:22 AM
Just out of curiosity, why nuke Keynote, Numbers and Pages?
These are good apps, especially Keynote.
Posted on 08-31-2021 06:33 AM
Disk space and users have other alternatives that are standard ie: Office 365.
Posted on 09-01-2021 12:46 PM
If they are the pre-installed version, and you use Apple School/Business Manager to assign them to machines, it will give error trying to update to newer versions.