Skip to main content
Question

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

  • March 7, 2018
  • 1 reply
  • 12 views

Forum|alt.badge.img+4

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

anverhousseini
Forum|alt.badge.img+11
  • Valued Contributor
  • March 7, 2018

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"