Avatar of aaromba
aarombaFlag for Australia asked on

How do I LDAP active users from AD

Hi All,

I have a query and desperetly need some advise :)

I need to LDAP all active users from AD. I'm very fresh to LDAP scripts (I can do OU=xxx,DC=company,dc=com ;) so I'm not sure how to script the filter.
Got this so far but it is not working (&(&(objectClass=user)(OU=company Users,DC=company,DC=com)))

I thought I will add a LDAP browser image to help out.

Any help will be greately apprecaited. Thanks :)

 
Databases

Avatar of undefined
Last Comment
aaromba

8/22/2022 - Mon
dacasey

Try
(&(&(objectClass=user)(CN=company Users,DC=company,DC=com)))
Chris Dent


You cannot filter based on OU within an LDAP query, you have to set a Search Root / Base for the query.

Chris
ASKER
aaromba

Thanksfor your feedback guys. Much appreciated.  

decasey, for some strange reason your query does not work. Perhaps this is my soft limitation.

Chris, I'm not sure (lack of experience in LDAP) what do you mean by set a search root / base for the query. Could you be a bit more specific please :) I'm an LDAP blond haha


Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Chris Dent


What are you using to do the query? Perhaps we can provide something with a bit more context? :)

Chris
ASKER
aaromba

sorry for late reply (Perth time :)
I am using HEAT (Service Desk app) LDAP. I have attached the screenshot of how it looks. Seems that I cannot use filters in Base DN. I can filter it using Object Classes (I believe, need to test it) below)   AD!
ASKER CERTIFIED SOLUTION
Chris Dent

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
aaromba

Ha! Chris This has worked beautifully! Thank you very much for your help mate!! Much appreciated!
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.