How do I create user accounts from the Terminal in Mac OS X 10.11?
If you are here and your system is running anything from 10.10 and newer, the sysadminctl command is your best friend. It does a lot of magic that DSCL can't do.

Here's the output for sysadminctl:

sysadminctl[21233:29122637] Usage: sysadminctl
    -deleteUser &lt;user name&gt; [-secure || -keepHome]
    -newPassword &lt;new password&gt; -oldPassword &lt;old password&gt; [-passwordHint &lt;password hint&gt;]
    -resetPasswordFor &lt;local user name&gt; -newPassword &lt;new password&gt; [-passwordHint &lt;password hint&gt;]
    -addUser &lt;user name&gt; [-fullName &lt;full name&gt;] [-UID &lt;user ID&gt;] [-password &lt;user password&gt;] [-hint &lt;user hint&gt;] [-home &lt;full path to home&gt;] [-admin] [-picture &lt;full path to user image&gt;]

Pass '-' instead of password in commands above to request prompt.


Then you'll want to do:

sudo createhomedir -c 2&gt;&amp;1 | grep -v "shell-init"


To add/remove users use dseditgroup:

sudo dseditgroup -o edit -a usernametoadd -t user admin
sudo dseditgroup -o edit -a usernametoadd -t user wheel