Skip to content

Instantly share code, notes, and snippets.

@magmel48
Created September 24, 2014 07:14
Show Gist options
  • Save magmel48/114a17228e35761d6efc to your computer and use it in GitHub Desktop.
Save magmel48/114a17228e35761d6efc to your computer and use it in GitHub Desktop.
var ldap = require('ldapjs');
var client = ldap.createClient({
url: 'ldap://XXX.XXX.XXX'
});
client.bind('XXX@XXX', 'XXX', function (err) {
if (err) {
console.log(err);
} else {
client.search('XXX', {filter: '(XXX=XXX)', scope: 'sub'}, function (err, res) {
if (err) {
console.log('err');
}
res.on('searchEntry', function(entry) {
console.log(entry.object.objectGUID);
});
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment