Send Command to Add remote users through ARD so I'm trying to create an extra admin account on all Macs on the network. There are quite a few so I'm trying to do it through Apple Remote Desktop.

Do you guys know how to do this? This is all I have so far which is obviously missing some parts and giving the error: "no tty present and no askpass program specified." Any help is appreciated.

#!/bin/bash
# This script creates a user account under Mac OS X
sudo dscl . create /Users/SecurityTest33
sudo dscl . create /Users/SecurityTest33 UserShell /bin/bash
sudo dscl . create /Users/SecurityTest33 RealName "Security Test3"
sudo dscl . create /Users/SecurityTest33 UniqueID 503
sudo dscl . create /Users/SecurityTest33 PrimaryGroupID 1000
sudo dscl . create /Users/SecurityTest33 NFSHomeDirectory /Local/Users/SecurityTest33   
sudo dscl . passwd /Users/SecurityTest33 PASSWORD
sudo dscl . append /Groups/admin GroupMembership SecurityTest33
sudo cp -R /System/Library/User\ Template/English.lproj /Users/SecurityTest33
sudo chown -R SecurityTest33:staff /Users/SecurityTest33
echo "Created user" #$USERID: $USERNAME ($FULLNAME)
The error you're getting is related to the sudo command.  You're probably trying to run the script as the normal administrator.  



Instead, you can run it directly as root.