This doesn't appear to be manageable through MDM or Apple, sadly. I had cursory search and it appears that it *may* be possible from the command line, which would involve either:
1. Creating a script to do this, packaging this and pishing it down to Macs.
2. Using the command line tool (Systems Manager > Command Line) to select multiple computers at the same time and running the various commands needed
But, it looks complex.... So, good luck.