Auto create users during installation

May 10, '04 08:57:00AM

Contributed by: Cap'n Hector

Ever have to set up a lab of computers, and then had to manually add users to each system using the Setup Assistant? Want to bypass that? Well, here's how. On each computer, create a file in /var/db named .InstallerConfiguration. It should be in this form:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Next two lines should be one with a space between... -->
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
 "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
 <key>Users</key>
 <array>
  <dict>
   <!-- This is optional. If it's not set, they aren't admin --!>
   <key>admin</key>
   <true/>     <!--can be false for a regular user. --!>
   <key>fullName</key>
   <!--Any name, is the "Full Name" in the Accounts field. --!>
   <string>Steve Jobs</string>
   <key>password</key>
   <string>set_user_password</string>
   <key>shortName</key>
   <string>steve</string>
   <!--Path to the user's image. This is optional. --!>
   <key>picturePath</key>
   <string>/Library/User Pictures/Fun/Orange.tif</string>
   <key>uid</key> <!-- User's UID. This is optional.--!>
  </dict>
 </array>
</dict>
</plist>
Each user is one <dict> entry, so you can do multiple users with one file. After creating the file, just run the normal OS X installer. When it reaches the Setup Assistant stage, it should just see and read from the .InstallerConfiguration file instead of asking for the user setup information.

I think that 10.3 deletes the file after it's done being used, but I'm not sure if 10.2 does. Either way, be careful to delete this file if you use this method of creating users...

Comments (3)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20040505021157823