Created
March 18, 2020 16:03
-
-
Save prodehghan/65d8093c9c7db93edf6922ea6f76b64d to your computer and use it in GitHub Desktop.
A sample node script for searching in Active Directory users, using "activedirectory2" package
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
var ActiveDirectory = require('activedirectory2'); | |
var config = { url: 'ldap://sgdc.SYSTEMGROUP.NET', | |
baseDN: 'dc=systemgroup,dc=net', | |
username: '[email protected]', | |
password: 'your_password' } | |
var ad = new ActiveDirectory(config); | |
var query = 'sAMAccountName=MohammadHD'; | |
ad.find(query, function(err, result) { | |
console.log(err); | |
console.log(result); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment