Skip to content

Miramac/simple-ad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-ad

Basic ldapjs wrapper for reading and writing AD objects. Currently only searching and editing of group members is implemented.

const ActiveDirectory = require('simple-ad')
require('dotenv').config()
const config = {
  url: process.env.LDAP_URL,
  username: process.env.LDAP_USER,
  password: process.env.LDAP_PASSWORD
}

const group = 'CN=MyGroupName,OU=MySubOU,OU=MyOU,DC=example,DC=com'
const ad = new ActiveDirectory(config)
ad.findGroup(group,
  ['dn', 'cn', 'member']
).then(result => {
  console.log(result)
}).catch(e) {
  // Some error
  console.error(e)
}

findGroup(groupDN, attributes)

isGroupMember(groupDN, memberDN)

modifyGroupMember(groupDN, memberDN, operation)

addGroupMember(groupDN, memberDN)

deleteGroupMember(groupDN, memberDN)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published