Created
December 3, 2012 19:23
-
-
Save akofink/4197281 to your computer and use it in GitHub Desktop.
Automatically assign admin rights in OS X based on Active Directory group membership
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set group name to check against | |
groupname=”domain admins” | |
if [ "`/usr/bin/dsmemberutil checkmembership -U $@ -G $groupname`" == "user is a member of the group" ]; then | |
/usr/bin/dscl . merge /Groups/admin GroupMembership $@ | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment