Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been working on this for days but simply cannot find the correct references to make it work.

The idea is to have a script that will baseline newly purchased Macs that comes into the company with basic stuffs like set autologin to off, create a new admin user (for remote admins to access for support, set password to unlock screensaver and etc) .

Sample list for baseline that admins have to do on each new machine:

Click the Login Options button

Set Automatic Login: OFF

Check: Show the Restart, Sleep, and Shutdown buttons

Uncheck: Show input menu in login window

Uncheck: Show password hints

Uncheck: Use voice over in the login window

Check: Show fast user switching menu as Short Name

(note: this is only part of a long list to do on each machine)

I've managed to find some references to make some parts work. Like autologin can be unset with "defaults write /Library/Preferences/.GlobalPreferences -bool TRUE" and I've kinda found ways to muscle in a new user creation (including prompts) with applescript and shell commands.

But generally its tough finding ways to do somewhat simple things like turn on password to get out of screensaver or to allow fast user switching. References are either too limited or just no where to be seen (e.g. i can unset autologin via cli but the very next setting on the system preference "show restart, sleep and shutdown buttons" is somewhere else and i can't find any command line to make it set)

Does anyone have any ideas on a list, document, reference or anything of where each setting on the system resides so that I can be pointed to make it work? or maybe sample scripts for the above example...

My thanks for reading thus far - a huge thank you for whoever that has any info on the above.

share|improve this question
up vote 1 down vote accepted

There is a better way to do this. The IT department at my company maintains a disk image with all of the settings in place they need to administer the Macs when they are received-including software in place registered with site licenses. They open the Macs and simply replace what's on the hard drive with the disk image.

Scripting is a logical path, but scripting System Preferences is a real bear because you have to go with GUI Scripting which is rife with problems, the least of which trying to decipher UIElementInspector to get what you need.

share|improve this answer
totally agreed with you but problem is now my satellite teams worldwide do not have a mac machine of their own to work off on. macs are only just appearing on our network. im kinda the "assumed" mac specialist. am trying to handhold my guys of seasoned windows admins in deploying them. railroading and automating is my current strategy now - i do have plans to work with images once this batch of a few hundred macs (different make and models) have been deployed and my guys have been "elevated" in mac admin knowledge. thanks for you reply :) – deeviate Jan 9 '11 at 15:37
If it's any help, my IT crew keeps the disk image on a Firewire drive. You could conceivably duplicate a starter image onto other drives and send it to your satellite teams. My recommendation sounds like a lot of trouble, but it would be much easier than scripting in the long run. Scripts can break, especially with significant OS updates and 10.7 is in the works, they have to be fixed which would be you and you alone from the sounds of it whereas a disk image only needs to use Software Update, and anyone can do that on their own from anywhere. – Philip Regan Jan 9 '11 at 15:48
If your company is large enough to have international satellite teams, then it has the resources to make this happen. Your company needs to step up here and implement proper Mac support. Anything else is a major drain on productivity. I was in the same position you are in now so I'm speaking from experience. – Philip Regan Jan 9 '11 at 15:49
thanks Phillip. totally concur with ya - in fact i've made that very fact known to my management. now if only they could just get over the dollar signs and send me on a mac education tour bearing gifts (mac machines for admin use and fw drives)! :) – deeviate Jan 9 '11 at 15:55

You're talking about things that would probably be easier to do with a mix UI scripting, and scripting System Preferences.
UI scripting is where you write an AppleScript that opens System Preferences and clicks buttons. Scripting System Preferences directly is where you talk to the app. Support for this is... patchy. You can use one where the other fails.

Here is some info about scripting System Preferences. Some info on UI scripting SysPrefs is here, and better examples can be downloaded here (direct link). They are installed to your ~/Library/Scripts/System Preferences folder.

Hope this helps. You can post back with specific questions

share|improve this answer
thanks nathan! you're a god sent! i glanced through the links and they seem the part. let me go down that avenue and report back. cheers! – deeviate Jan 9 '11 at 15:41

Even if you can't script all these change, try a different approach:

  • Make the changes on your computer
  • Find out what files/folders are modified by these changes
  • Ship these few files to the remote computers with instructions (or a script) that copies them to the correct locations
share|improve this answer

From my experience, there are 2 ways to go:

1: create a "master"-image and distribute it on to your new Macs (I do this through NetRestore) which takes more time to invest in the beginning but is easier to handle for your Windows-admins to handle (just re-imaging a Mac is easy)

2: Download Apples Server Admin Tools, install them on a fresh Mac and use the Workgroup Manager to configure the "localhost" settings the way you want them. Those MCX settings then can be exported and it´s easier to cope with system updates (you don´t have to re-create a new "master"-image)

For more information I´d suggest reading through and - they have loads of information on these topics.

share|improve this answer

thank you folks - coming from someone who has almost zero knowledge of supporting macs on an enterprise level, i really appreciate all the replies. for one, it has broadened the spectrum of how and what I can do to achieve the said target is.

i've took up most of your pointers and they have forked into many other areas of exploration and learning of ways and means to get the job at hand done. i've decided on a "blended" solution that kinda gets it done - provision with applescript, calling in a shell script and a little bit of UI scripting all done within a single double clickable executable - that should help with the pressure of quick roll out for now.

I am working on laying on the imaging route for our next big wave of macs coming in as i type now :)

share|improve this answer
Please don't add "thank you" as an answer. Instead, vote up the answers that you find helpful. – Mark Mar 13 '15 at 11:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.