Script Example:
sudo dscl . -create /Users/ITAdmin
sudo dscl . -create /Users/ITAdmin UserShell /bin/bash
sudo dscl . -create /Users/ITAdmin RealName ITAdmin
sudo dscl . -create /Users/ITAdmin UniqueID 502
sudo dscl . -create /Users/ITAdmin PrimaryGroupID 20
sudo dscl . -create /Users/ITAdmin NFSHomeDirectory /Local/Users/ITAdmin
sudo dscl . -create /Users/ITAdmin NFSHomeDirectory /Users/[ITuser]
sudo dscl . -passwd /Users/ITAdmin [password]
sudo dscl . -append /Groups/admin GroupMembership ITAdmin
When using this locally or remotely, it works except the Home folder does not create or show up in the UI. After further testing, it does show up after an initial first time login. With our remote workforce and the secondary reasons for needing this script, we're trying to find a way to mimic a user login to add into our actual other script so that the home folder is created without actual end user interaction (won't be possible.)
Or are there any other alternative ways to script a new admin user account?
(Or a better place to ask this?)
Thanks in advanced!