Solved

LDAP Query OR statement

Posted on 2008-06-26
3
4,512 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
  • 2
3 Comments
 
LVL 30

Accepted Solution

by:
LauraEHunterMVP earned 125 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

A quick step-by-step overview of installing and configuring Carbonite Server Backup.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
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 from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
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…

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now