macOS Preferences – How to Script Setup of Preferences

-setupdefaultsinstallpreferencessystem-prefs

I have a couple of Macs and I would like to create some kind of script that I can use to:

  1. Easily setup a new Mac after a reinstall
  2. Update settings to consistent values (so if I decide to change some preferences on Mac A, I can run the script on Mac B to get it to match)

I'd be happy if I could use this script to customize:

  • System Preferences
  • Finder Preferences

I would prefer a method where I can use a script or config file to specifically set certain settings I choose to certain values. I don't really want something that will import/export ALL settings indiscriminately.

I also don't want some complicated IT management solution, since this is really just for me.

Best Answer

You should take a look at Mathias Bynens' Dotfiles. Modify it for your needs and delete the settings you don't need. Then you only need to execute the script with the terminal.app via entering sudo /path/to/the/script/./osx on each mac.