Often times I find myself wanting to view a print out of currently installed configuration profiles on a machine, but either can’t or don’t want to use the GUI. This would normally consist of going to System Preferences > Profiles to view a list of all profiles installed.
This method is useless if I am ssh’d into a box or am running a script remotely, etc.
You can run profiles -C in terminal to get a basic output of your profiles but if they were created using Jamf, then they’re not named in a very human-readable format.
As you can see above, only 2 of the installed profiles spit out a identifiable name since these were created using manually and proper names were assigned. Profiles created in Jamf are given a random string identifier.
Now, if you print out the above command in a verbose mode, profiles -C -v you get more data than we need for this:
The above is just a snippet of the verbose command showing the output for 1 (one) single configuration profile, now imagine having 10+ installed and getting all of that output.
You can however see the first line of this output contains attribute: name: MDM Profile. This is what we want to capture. You can cut this output in half by just piping the output to grep and looking for attribute: profiles -C -v | grep attribute.
To take it one step further and make the output look really readable, we can pipe it a couple more times to do some string manipulation: