Skip to content

Instantly share code, notes, and snippets.

@ccondry
Created April 18, 2019 20:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ccondry/70198857c173c0564479d9073a1429fe to your computer and use it in GitHub Desktop.
Save ccondry/70198857c173c0564479d9073a1429fe to your computer and use it in GitHub Desktop.
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