Issue removing configuration profiles in High Sierra

agetz
Contributor

I know this is probably not best practice but it has been working for us in Sierra. We sometimes will have issues with configuration profiles not updating for whatever reason and previously we were able to remove or rename the ConfigurationProfile folder in var. Rebooting after this would cause it to recreate the file and bring in new profiles, fixing our issue. Now with High Sierra we are no longer able to accomplish this. I am trying to find a way to provide the same functionality a different way. Because there is a prompt with the command, I am having some issues getting it to work. Any help or recommendations would be greatly appreciated. Thanks.

#!/bin/bash
#
/usr/bin/expect<<EOF

spawn /usr/bin/profiles -D
expect {

"Are you sure you want to remove all device configuration profiles? [y/n]:" {
        send "y
"
        exp_continue
    }

}
EOF
0 REPLIES 0