Skip to content

Instantly share code, notes, and snippets.

@BaddMann
Last active November 9, 2016 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BaddMann/f7d7d641fa3ef6c1bee451de8863be5d to your computer and use it in GitHub Desktop.
Save BaddMann/f7d7d641fa3ef6c1bee451de8863be5d to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import plistlib
import os
from Foundation import CFPreferencesCopyAppValue
# Read the location of the ManagedInstallDir from ManagedInstall.plist
BUNDLE_ID = 'ManagedInstalls'
pref_name = 'ManagedInstallDir'
managedinstalldir = CFPreferencesCopyAppValue(pref_name, BUNDLE_ID)
# Read Munki's Report
ManagedInstallsReportitemspath = os.path.join(managedinstalldir, 'ManagedInstallReport.plist')
#Retrive Important Values, add strings for Jamf if needed.
pref_name_now = 'Warnings'
munkiwarnings = CFPreferencesCopyAppValue(pref_name_now, ManagedInstallsReportitemspath)
pref_name_now = 'Errors'
munkierrors = CFPreferencesCopyAppValue(pref_name_now, ManagedInstallsReportitemspath)
print "Munki Warnings:", munkiwarnings
print "Munki Errors:", munkierrors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment