?
Solved

LDAP Query OR statement

Posted on 2008-06-26
3
Medium Priority
?
4,616 Views
Last Modified: 2012-06-21
I'm hoping this is a very easy question. I've tried looking through existing Q&As but couldn't find anything similar. I'm trying to develop a Search Query in ADUC. What I need is a list of active users that have an office location populated with one of the mulitple options I give. So, the list will show me Jon in office 5, Joe in office 8, etc.

Here's what I have -
(&(&(objectCategory=user)(physicalDeliveryOfficeName=5)(objectCategory=user)(physicalDeliveryOfficeName=8)(&(&(objectCategory=user)(!userAccountControl:1.2.840.113556.1.4.803:=2)))))

Any help or direction will be greatly appreciated.
thanks.
0
Comment
Question by:DESIGNUTT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 30

Accepted Solution

by:
LauraEHunterMVP earned 500 total points
ID: 21875365
To start with, unless you have indexed objectClass, you need to search on "(&(objectcategory=Person)(objectClass=User))

If I'm understanding you correctly, you want to craft the following query:

Show me users who are not disabled AND who are in office locations 3 OR 4 OR 5 OR...

I don't have a testbed in front of me right now, but it'll be something similar to the following:

"(&(objectcategory=person)(objectclass=user)(!userAccountControl:1.2.840.113556.1.4.803:=2)(|(physicalDeliveryOfficeName=5)(physicalDeliveryOfficeName=8)))"
0
 

Author Comment

by:DESIGNUTT
ID: 21875532
I tried what you posted. I get an error "not a valid string". I tried to add using Custom Search by field user contains 8. That's how I got the string that I originally posted.

I will keep trying to tweak. Any other info would be helpful too.
thanks.
0
 

Author Comment

by:DESIGNUTT
ID: 21875898
I got it! Something was strange on my existing query. I created a new one from scratch, and that seemed to work! Thanks for your prompt response.
0

Featured Post

Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
Suggested Courses

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question