Skip to content

Instantly share code, notes, and snippets.

@BaddMann
Last active Nov 9, 2016
Embed
What would you like to do?
#!/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