Simplified script to create a new admin hidden or unhidden with an option to change user's picture
#!/bin/bash
#Created by Shahak Tzarfaty Wediggit LTD 27/3/19
#Choose your argumets carefully , idnumber can't be created twice on the same computer.
#if you want to enable a hidden user id it should be less than 500,
#Also to enable hidden user add "dscl . create /Users/$admin IsHidden 1".
#variables
admin=lala
password=1234
fullname="LaLa"
idnumber="572"
#do not edit the animals bellow
eagle="/Library/User\ Pictures/Animals/Eagle.tif"
owl="/Library/User\ Pictures/Animals/Owl.tif"
parrot="/Library/User\ Pictures/Animals/Parrot.tif"
zebra="/Library/User\ Pictures/Animals/Zebra.tif"
#create wdiadmin user admin account
dscl . -create /Users/$admin
dscl . -create /Users/$admin UserShell /bin/bash
dscl . -create /Users/$admin RealName $fullname
dscl . -create /Users/$admin UniqueID $idnumber
dscl . -create /Users/$admin PrimaryGroupID 20
dscl . -create /Users/$admin NFSHomeDirectory /Users/$admin
dscl . -passwd /Users/$admin $password
dscl . -append /Groups/admin GroupMembership $admin
#hide account
#dscl . create /Users/$admin IsHidden 1
#variable
#choose an animal $eagle , $owl, $parrot or $zebra
profilepic=$eagle
#show input menu in login window" enabled
defaults write /Library/Preferences/com.apple.loginwindow showInputMenu -bool TRUE
#add picture file
dscl . -append /Users/$admin Picture $profilepic
exit 0