Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ad

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ad

Active Directory API for Node

  • 0.1.0
  • npm
  • Socket score

Version published
Weekly downloads
109
decreased by-29.68%
Maintainers
1
Weekly downloads
 
Created
Source

AD

Making Active Directory jQuery-easy.

[]


AD is a Javascript implementation of common Active Directory tasks, built to be simple as possible.

Really simple. jQuery-simple (it doesn't do addition though).

You can use async / await:

(async () => {
	try {
		await ad.user().add({
			userName: 'jsmith'
			firstName: 'John',
			lastName: 'Smith',
			location: '/Users/Sales',
			password: 'J@vascr!pt1'
		});
		await ad.group().add('Sales');
		await ad.user('jsmith').addToGroup('Sales');
	} catch(err) {
		// ...
	}
})();

Or stick with promises:

	ad.user('agnes').changePassword('d0ntForgetThisTime')\
		.then(() => ad.user('crook').disable())
		.then(() => ad.user('larry').move('Dungeon'))
		.catch((err) => {
			// ...
		});

Getting Started

First, install the library:

npm i ad
yarn add ad

Then add this to index.js:

const AD = require('ad');

const ad = new ad({
	url: "ldaps://127.0.0.1",
	user: "dthree@acme.co",
	pass: "howinsecure"
});

And you're off to the races.

API

ad.user().get(opts)
ad.user().add(opts)
ad.user(username).get(opts)
ad.user(userName).exists()
ad.user(userName).addToGroup(groupName)
ad.user(userName).removeFromGroup(groupName)
ad.user(userName).isMemberOf(groupName)
ad.user(userName).authenticate(password)
ad.user(userName).password(password)
ad.user(userName).passwordNeverExpires()
ad.user(userName).passwordExpires()
ad.user(userName).enable()
ad.user(userName).disable()
ad.user(userName).move(location)
ad.user(userName).unlock()
ad.user(userName).remove()
ad.user(userName).location()

ad.group().get(opts)
ad.group().add()
ad.group(groupName).get(opts)
ad.group(groupName).exists()
ad.group(groupName).addUser(userName)
ad.group(groupName).removeUser(userName)
ad.group(groupName).remove()

ad.ou().get(opts)
ad.ou().add(opts)
ad.ou(ouName).get()
ad.ou(ouName).exists()
ad.ou(ouName).remove()

ad.other().get(opts)
ad.all().get(opts)
ad.find(searchString)

Why?

Active Directory / LDAP can be hard. Some of us are stuck with it, so I wanted to make it easier.

License

MIT

Keywords

FAQs

Package last updated on 23 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc