Applies to: All versions of Centrify DirectControl on Mac OS X
Is there a way to make an AD user a local admin on a Mac system without having to use the DirectControl Console and Group Policies?
The standard way to make a single AD user local admin is to have that AD user log into their session and then go to:
- System Preferences > Users & Groups > Enable the "Allow user to administer this computer" checkbox.
- It will then prompt for an existing local admin to enter their credentials before allowing the AD user to be elevated in status.
To elevate an AD user without needing them to log into the Mac first, use the steps below:
Log into the Mac as an existing Local Admin and run the following Terminal command:
sudo dseditgroup -o edit -a [username] -t user admin
For example if the AD username was "bob", then the command would be:
sudo dseditgroup -o edit -a bob -t user admin
The next time the AD user "bob" logs into that particular Mac, the account will be registered as an Admin user.
To remove a user from the Local Admin group, use:
sudo dseditgroup -o edit -d [username] -t user admin
(Note that if GPs can be used, these commands can also be pushed via the "Specify commands to run" GP in the Common UNIX Settings folder)
Note: To add AD groups into the local admin group, please see: