Mo more Managed Prefs in Jamf 10 - how to set default apps on clients?

ChrisJScott-wor
New Contributor III

Looking to find a way to set default app for PDFs on our clients (looking to wean them off of Adobe Reader) and it seems as if Managed Preferences would've worked but that appears to no longer be included in JAMF Pro v10...

I've seen a number of references to duti (https://github.com/moretension/duti) but, since typical macOS 10.13 systems don't seem to able able to wget and compile, I have no way of getting that utility onto a user's system in order to set defaults using it!

Anybody got any thoughts on this?

1 REPLY 1

anverhousseini
Contributor II

You can create a PKG from Homebrew with brew-pkg: https://github.com/timsutton/brew-pkg

From there you just have to run a script like this with execution frequency "Once per user per computer":

#!/bin/bash

currentUser=$(python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "
");')

su -l "${currentUser}" -c "/usr/local/bin/duti -s com.adobe.Reader com.adobe.pdf all"
su -l "${currentUser}" -c "/usr/local/bin/duti -s com.adobe.Reader public.composite-content all"