we have a policy to restrict access to "Users & Groups" under system preferences, but we do allow the user to be local admin, and I used to be able to use the following script so users can give themself local admin right from self service, but it stopped working.
we are using MacOS 10.12.x (x=3,4,5,6) and 10.11.x (x=5 and 6)
and JSS 9.96
does anyone have a different way of creating a self service policy so the users can make themself local admins ?
thank you in advance for your help.
#!/bin/sh
if [ -z $3 ];
then
currentUser=`stat -f '%Su' /dev/console`
else
currentUser=$3
fi
# Add the current user to the local admin group on the Mac
dseditgroup -o edit -a $currentUser -t user admin
if [ "$?" == "0" ];
then
echo "Successfully added $currentUser to admin group"
else
echo "ERROR: Unable to add $currentUser to admin group"
exit 1
fi
exit 0