Skip to content

Instantly share code, notes, and snippets.

@akofink
Created December 3, 2012 19:23
Show Gist options
  • Save akofink/4197281 to your computer and use it in GitHub Desktop.
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
#!/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