So, my colleague made a script couple years ago that showed an input window where you could write the username and it would then add that user as domain admin user in users and groups. The script looked like this:
tell application "Finder"
activate
set user_name_dialog to display dialog “Enter end user account name:” default answer “” buttons {“OK”,“Cancel”} default button "OK"
end tell
set user_name to text returned of user_name_dialog
do shell script "/System/Library/CoreServices/ManagedClient.app/Contents/Resources/createmobileaccount -n " & user_name & space & “-v” with administrator privileges
do shell script “dseditgroup -o edit -a " & user_name & " -t user admin” with administrator privileges
Seems that the script is no longer working and I assume the reason being the tightened security in El Capitan (root account got smashed). The script runs fine from Bigfix but the user cannot install anything even thou Users and Groups says he/she has administrator privileges. This is fixed if I delete the user and we manually create the user again.
I don’t have much experience in Applescript so I’m kinda stuck for the moment. Any ideas? Should I even user applescript or try something completely different?