Created
April 18, 2019 20:02
-
-
Save ccondry/70198857c173c0564479d9073a1429fe to your computer and use it in GitHub Desktop.
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
function addToGroup(client, dn) { | |
var groupDn = "CN=MyGroup,OU=groups,DC=mydomain,DC=com"; | |
var change = new ldap.Change({ | |
operation: 'add', | |
modification: { | |
member: [dn] | |
} | |
}); | |
client.modify(groupDn, change, function(err, res) { | |
if (err) { | |
console.error("Looks like group add FAILED: %j", err); | |
} else { | |
console.log("Looks like group add WORKED: %j", res); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment