Add user to admin group with Applescript
Need a way for your team to easily make a network or local user an admin? Copy and paste the code below into Script Editor (Applescript Editor in 10.6) and save it as an application. This can be used before deploying a machine to the user, or after they’ve logged in.
(* Add user to admin group This script should not need any modification, unless you want to "brand" it. http://macadmincorner.com *) tell application "System Events" set shortName to name of current user end tell set userName to text returned of (display dialog "Enter the users shortname" default answer shortName) do shell script "dseditgroup -o edit -a " & userName & " -t user admin" with administrator privileges display dialog (do shell script "dscl . -read /Groups/admin users") with title "The following users are admins on this machine" buttons "Ok" default button 1
Related posts:
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.



This is a excellent way of seeing things, not that hard for you to learn. Thank you for finding time to share your your current thinking.