Created
March 29, 2018 17:31
-
-
Save seanmckinley/1914a1682725769b44bd5b2d3eb6430e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
## Code binds to LDAP, searches users, returns multi-dimensional array for groups like so. | |
## Each element in the array represents a given users AD groups | |
## user_groups = [ [group1,group2], [group2,group3], [group2,group4] ] | |
My goal here is to get the common groups among all of the arrays and the only way I've found so far is this: | |
user_groups[0] & user_groups[1] & user_groups[2] | |
=> [group2] | |
Unfortunately, that's pretty static and only works for 3 users and I'm too dumb to think of a clever way to do this better. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment