Policy or Script to Remove Garageband, Pages, Numbers and Keynote

MBlank
Contributor

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. 

7 REPLIES 7

sdagley
Esteemed Contributor II

@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.

MBlank
Contributor

Thanks. Should each "rm" command be attached to a separate policy? Can they all be bundled together in one policy or script? 

sdagley
Esteemed Contributor II

@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.

L-plateAdmin
Contributor

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..

Pickyvegan
New Contributor II

Just out of curiosity, why nuke Keynote, Numbers and Pages?

These are good apps, especially Keynote.

Yogi

Disk space and users have other alternatives that are standard ie: Office 365. 

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.