Skip to main content

I see a lot of threads on how to show some information about installed profiles using the profiles command.



Anybody know how I can use bash to read specific values from a profile?



I want to use it to get a configured server URL that is only easily available via configuration profile on a freshly deployed system.

@nathan.perkins You aren't going to be able to access the profile itself after installation (at least as of High Sierra), but if you know what domain the profile was going to modify you should find the .plist with those settings in /Library/Managed Preferences/ and you can read them with the defaults tool.


While it's not possible to directly read a configuration profile when it's installed, it's still possible read the active settings for a domain. For example, if you specify a specific Safari HomePage in a configuration profile but the user hasn't, the following one-liner will still read the com.apple.Safari domain settings and return the configured HomePage.



You'll need to replace key with the key in the plist or profile you're trying to read and you'll need to replace com.domain.app with the domain the configuration profile is managing



python -c "from Foundation import CFPreferencesCopyAppValue; print CFPreferencesCopyAppValue('key', 'com.domain.app')"

https://gist.github.com/gregneagle/010b369e86410a2f279ff8e980585c68


Thank you all for your wonderful suggestions. I'll check them out :)


In case anyone else comes across this thread, system_profiler SPManagedClientDataType command may also come in handy.


In case anyone else comes across this thread, system_profiler SPManagedClientDataType command may also come in handy.


ive tried looking at that on macOS 15 but come back with nothing


ive tried looking at that on macOS 15 but come back with nothing


@tkimpton What version of macOS 15 are you running? Running "system_profiler SPManagedClientDataType" in Terminal on macOS 15.1 works for me.


ah it seems you can't run it as root user which sucks. Would have been good to use it in some workflows.


Reply