Remove all profiles using script with wildcard

joelsenders
New Contributor III

Hello all,

I'm cutting over from a previous MDM to Jamf. My previous MDM is not working so well right now, and so trying to unenroll/remove config profiles that are on all of my client Macs is proving very difficult. My idea was to create a policy that would run at enrollment and remove profiles that were pushed with the other MDM. I had used profiles -P to get the names of these profiles so I could remove them using profiles -R -p. Problem is, there are some out there that were manually installed, some that are old and I can't get the identifiers for, etc. Rather than try and inventory all of the profiles out there and have a separate line of code for each, isn't there a way to use a wildcard to remove profiles? For example, all of my old MDM's profiles start with this:

com.apple.mdm.server.school.edu

However, I can't run:

profiles -R -p com.apple.mdm.server.school.edu*

My life would be much easier if there was a way to script this.

2 REPLIES 2

rickgmac
Contributor

profiles -D -f

-D = Deletes all existing configuration profiles. It will not update any existing managed preferences. (Requires root privileges)
-f = Automatically confirm any questions, or when used with -s, will retry startup profiles at each startup until successfully installed.

joelsenders
New Contributor III

Thanks! Not sure how I missed that flag. Appreciate it.