Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two searches in one ? #217

Open
Cliff-R-K opened this issue Feb 4, 2020 · 0 comments
Open

Two searches in one ? #217

Cliff-R-K opened this issue Feb 4, 2020 · 0 comments

Comments

@Cliff-R-K
Copy link

Cliff-R-K commented Feb 4, 2020

Firstly I must admit that I am completly new to active directory and this is my first attempt trying to collect data using ad.

I managed to get a simple example working:

const config = {
  url: "ldap://<url>",
  baseDN: "OU=Users,OU=Default,DC=<dc>,DC=intra,DC=local",
  username: "<user>",
  password: "<pass>"
};

let sAMAccountName = "test";

let ad = new ActiveDirectory(config);
ad.findUser(sAMAccountName, function(err, user) {
  console.log(JSON.stringify(user.displayName));
});;

But then I need to use the variable user.displayName in another search using another baseDN:
baseDN: 'OU=Laptops,OU=LmComputers,DC=<dc>,DC=intra,DC=local'

to be able to get the returned users computer-info. What is the preferred way to do this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant