I would like to script the uninstallation and reinstallation of Profiles on a group of Networked Macs. In order to do this I shall use the UNIX Command part of Remote Desktop.

When sending the

profiles -D

Command, it responds with

Are you sure you want to delete all configuration profiles? [y/n]:

but I have no way of pressing the Y key.

Any ideas?

  • Guesswork, hence comment not answer, but what other parameters other than -D can you send? Is there a -Y for example? – stuffe May 7 '14 at 22:34
  • Yeah I tried that, but it seems -f does the trick! – Josh May 8 '14 at 6:17
  • You can pipe yes to the command as well... => $ yes | profiles -D – Charles Addis Jan 21 '17 at 20:16

Checking the profiles man page, the -f flag will:

Automatically confirm any questions, or when used with -s, will retry startup profiles at each startup until successfully installed.

So, my guess is profiles -Df is what you're looking for.

  • Can't believe I didn't see that myself! Thanks – Josh May 8 '14 at 6:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .