AFP548

Creating new opendirectory users from script or terminal

Hi, What is the easiest way to script the creation of opendirectory users? At our site one of the admins, usually me, gets a form filled out and emailed for each new user including basic info (full name) and some special info (the desired shortname and when the account should expire). I have several helper scripts for things like choosing a random password, creating the user's homedirectory on the NFS server, adding the user to the site mailing-list, and optionally setting up mail forwarding. What I don't have is a script which could create the actual user account. What is the best way to do this? I can't just do "useradd" for od users, right? Do I have to create a delimited file and feed it to dsimport? TIA
Exit mobile version