Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var path = require('path');
- var ActiveDirectory = require('activedirectory');
- var directoryConfig = {
- url: 'ldap://'+process.env['USERDNSDOMAIN'],
- baseDN: 'dc=xxx,dc=yyy,dc=zzz',
- username: process.env['USERPROFILE'].split(path.sep)[2],
- password: 'test'
- }
- router.get('/', function(req, res) {
- var ad = new ActiveDirectory(directoryConfig);
- ad.userExists(directoryConfig.username, function(err, exists) {
- if (err) {
- console.log('ERROR: ' +JSON.stringify(err));
- return;
- }
- console.log(directoryConfig.username + ' exists: ' + exists);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement