Skip to main content
Solved

_mbsetupuser and Giving local admin rights

  • December 15, 2015
  • 2 replies
  • 38 views

Forum|alt.badge.img+7

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

Best answer by Bhughes

Perfect! Thanks @davidacland That worked!

2 replies

davidacland
Forum|alt.badge.img+18
  • Valued Contributor
  • December 15, 2015

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.


Forum|alt.badge.img+7
  • Author
  • Contributor
  • Answer
  • December 16, 2015

Perfect! Thanks @davidacland That worked!