Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Auto create users during installation Install
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...
    •    
  • Currently 1.33 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[5,874 views]  

Auto create users during installation | 3 comments | Create New Account
Click here to return to the 'Auto create users during installation' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Auto create users during installation
Authored by: Thom on May 10, '04 01:47:43PM

What if you've already created a 'loadset' that you could blast onto each machine's hard drive, with a standard 'admin' user, and wanted to create subsequent users?

Our goal is to quickly roll out machines to staff. If we copy our loadset image to a machine's hard drive, then use a file like the one you describe to automate the creation of subsequent users, this could speed up the roll-out process.

I'm aware of some scripts that have been released already which mirror the user creation process, which can be run from the command line. But this method would appear to be a more 'acceptable' means of creating new users; scripts like that are just second-guessing what the install process does, and become dated the minute they're released.

i.e. when a new version of the system comes out, even a minor rev perhaps, the script needs to be updated to reflect any changes to the user creation process.



[ Reply to This | # ]
Auto create users during installation
Authored by: Cap'n Hector on May 11, '04 03:04:34AM

This works at only one time: At the time that the New User Setup assistant runs. You might be able to automate this by blasting /var/db/netinfo/local.nidb (this forces the Setup Assistant to run)…but that might give unexpected results if the user's UID changes while the short name remains teh same.



[ Reply to This | # ]
Auto create users during installation
Authored by: Cap'n Hector on May 11, '04 03:09:17AM

Whoops, I read your post too fast…My last note was responding to a mis-reading of the first comment.

Yes, this is less fragile than scripts that second-guess the user creation process. I wouldn't expect to see this break except at major version changes to the OS.



[ Reply to This | # ]