Posted on 01-30-2013 10:36 AM
I am using the Jamf bind to Active Directory and we are adding "Domain Users" group as a group that can administer the Mac for now. I am noticing the check box to "Allow user to administer this computer" keeps toggling off/on for users. I did see it before we started using Jamf but wanted to inquire if anyone has seen this happening regularly as well and if so, any fixes? I am sure it is a OS X bug/issue but just wanted to ping everyone here. Thanks in advance
Posted on 01-30-2013 10:38 AM
To note, I have enabled the "Mobile account" option when binding/logging on for first time.
Posted on 01-30-2013 12:58 PM
We have this issue only when our Macs can't talk to our Domain controllers. When on campus, the LDAP lookup can see if theyre in the admin group and allow them to administer the computer. What we have to do is log on as the user, cache the creds, turn off the network (aka remove it from campus / kill communication with your DC), and then log in as the user. Unlock the preference pane with a local admin account, and then check the Administrator checkbox for the user. This will allow user to remain admin regardless of communication with the DCs.
Posted on 01-30-2013 02:23 PM
this is expected behavior. If you're granting admin rights via an AD group, the rights will only be granted when the machine can talk to the AD domain.
If you want to have the admin rights survive while disconnected, you'll want to add the AD account to the local admin group using DSCL or DSEDIT in a script. If you're ok with doing this manually on each machine,rhs615's post will work, too
Posted on 01-31-2013 08:28 AM
I am sure there are some examples of the decl or dsedit script but anything handy anyone can provide? Thanks for the info. This is good to know.
Posted on 01-31-2013 08:38 AM
dscl . -append Groups/admin GroupMembership username
or
dseditgroup -o edit -a username admin
Posted on 01-31-2013 08:46 AM
Last clarification on this, do you have to use individual AD usernames or can you use a domain group via this method?
Posted on 01-31-2013 08:48 AM
AD groups will not resolve when not connected to the network. so you would be right back to where you started.
Posted on 01-31-2013 08:51 AM
Thank you all. I'll start testing it out.
Posted on 01-31-2013 08:59 AM
Get current user account's short name:
loggedInUser=$( ls -l /dev/console | awk '{ print $3 }' )
or
loggedInUser=$( who | awk '/console/{ print $1 }' )
Checking a user's admin status:
/usr/sbin/dseditgroup -o checkmember -m $loggedInUser admin
Example Result: yes, johndoe is a member of admin
Making a user a member of the local admin group:
sudo /usr/sbin/dseditgroup -o edit -a $loggedInUser -t user admin
You can also build a process that would loop through all locally cached accounts on the Mac, for example, anything in /Users/ and make them all members of the local admin group. Look around here on JAMFNation to find some examples of looping through all local accounts.
Posted on 01-31-2013 09:09 AM
@mm2270: Am I reading this correctly? Does this script add to the local admin group based on whether it is given admin from the domain?
If so, that is far more elegant than my current solution.
Posted on 01-31-2013 09:23 AM
@msblake, No, that's not what I was saying. The line checking admin status above is just checking if the account is already part of the local admin group. It could also return a "no" response, at which time you could run the next line in a script to make them part of the local machine's admin group.
Though I'm guessing there is likely a way to check a user's AD group status and determine if they should be made a local admin on the Mac. That seems doable, but would require the Mac be in sight of the domain controllers to work of course.
Posted on 07-22-2013 08:16 AM
I have had the same issue a few times. (Allow User to Administer this Computer button toggles on and off) However, mine have nearly always been resolved by repairing permissions on the Mac.