I can't take full credit for this. I found it at:
http://farbflash.de/cgi-bin/blosxom.cgi/?find=snippets
I did, however, know the command to look for.
The commands necessary to create an admin user are as follows:
sudo -s
niutil -create . /users/username
niutil -createprop . /users/username passwd ""
niutil -createprop . /users/username home /Users/username
niutil -createprop . /users/username shell /bin/tcsh
niutil -createprop . /users/username uid 520
niutil -createprop . /users/username gid 20
niutil -createprop . /users/username realname "First Last" - if this property is not created, the user won't appear in the loginwindow!
niutil -appendprop . /groups/admin users username - only for admin users!
These below are optional:
niutil -createprop . /users/username hint "password hint"
niutil -createprop . /users/username
writerspassword username
niutil -createprop . /users/username
writershint ""
niutil -createprop . /users/username
writerspicture username
niutil -createprop . /users/username sharedDir Public
exit
There needs to be a valid home directory, shell, and/or SharedDir for the user. A home directory can be created as easily as:
sudo mkdir /Users/username
sudo chown username:staff /Users/username
Or if you want the default OS X user directory structure:
sudo cp -rp /System/Library/User Template/English.lproj /Users/username
sudo chown -R username:staff /Users/username
(/System/Library/User Template also has other localized language templates)
Additional info:
To change an admin user back to an ordinary user:
sudo niutil -destroyval . /groups/admin users username
Be careful to leave at least one accessible admin user, otherwise you will lock yourself out of your machine.
after changing netinfo:
sudo niutil -resync .
log out and in the user you changed.