Last active
March 7, 2016 22:55
-
-
Save WardsParadox/a678cb2e1187923b97e7 to your computer and use it in GitHub Desktop.
Get OS X Preference with Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from Foundation import CFPreferencesCopyValue, \ | |
kCFPreferencesAnyUser, \ | |
kCFPreferencesAnyHost | |
def getpreferencekey(keytolookup): | |
''' | |
Returns Value for Requested Key in ManagedInstalls | |
''' | |
return CFPreferencesCopyValue(keytolookup, "/Library/Preferences/ManagedInstalls", | |
kCFPreferencesAnyUser, kCFPreferencesAnyHost) | |
munki_cid = getpreferencekey("ClientIdentifier") | |
munki_server = getpreferencekey("SoftwareRepoURL") | |
print munki_cid | |
print munki_server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment