All - using the following script we are giving the user local admin rights. It is set for Login, once per user per computer.
#!/bin/bash
loggedInUser=$(stat -f '%Su' /dev/console)
evaluate=$( /usr/sbin/dseditgroup -o checkmember -m $loggedInUser admin )
echo $evaluate
case $evaluate in
*yes* ) echo User is already an admin on this mac;;
*no* ) /usr/sbin/dseditgroup -o edit -a $loggedInUser -t user admin;;
* ) echo Something went wrong;;
esac
We're seeing an issue, intermittently, where the user isnt getting the rights. In the logs, it looks like its triggered when _mbsetupuser is logged in, and not the actual user we are using... What is _mbsetupuser, and does anyone know why this might be happening?
Thanks!
Ben