Posted on 12-15-2015 01:11 PM
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
Solved! Go to Solution.
Posted on 12-16-2015 06:01 AM
Perfect! Thanks @davidacland That worked!
Posted on 12-15-2015 01:34 PM
That user is part of the upgrade process for 10.11.x. If you're using once per computer per user, it should run again when the actual user logs in, so you just need to add an if statement to exit if the _mbsetupuser is logged in.
Posted on 12-16-2015 06:01 AM
Perfect! Thanks @davidacland That worked!