Solved

A more efficient LDAP filter

Posted on 2016-09-20
3
85 Views
Last Modified: 2016-09-21
Each attribute here is definitely indexed, but the search takes too long.

What can I do to make it more efficient?

(&(|(mail=John.M.Doe@*)(proxyAddresses=*:John.M.Doe@*))(!(employeeID=123456)))

Open in new window

0
Comment
Question by:Dallas Smetter
3 Comments
 
LVL 6

Expert Comment

by:sAMAccountName
ID: 41807717
you could try using ambiguous name resolution and scoping the search to a targeted subtree.

I'm on mobile or I'd post a link, but you can easily Google " active directory anr" and get some good info
0
 
LVL 17

Accepted Solution

by:
Learnctx earned 500 total points
ID: 41807889
The reason your response time is so horrible is you have an open ended filter in your query:

(proxyAddresses=*:John.M.Doe@*)

Open in new window


This means you will generate a hugely inefficient query. Even though the attributes are indexed, you're going to end up touching every object in the directory that has a proxyAddresses attribute populated.

Is there any reason you're not specifying the protocol? You would be better to include the protocols you're looking for. Its always better to be more specific if you want a quick result. Either that or you need another attribute which limits the query scope instead of (!(employeeID=123456)).

This should return an instant result.

(&(|(mail=John.M.Doe@*)(proxyAddresses=smtp:John.M.Doe@*)(proxyAddresses=sip:John.M.Doe@*)(proxyAddresses=notes:John.M.Doe@*))(!(employeeID=123456)))

Open in new window


you could try using ambiguous name resolution and scoping the search to a targeted subtree.

ANR is great but in this case won't work any better than just using proxyaddresses, in my opinion.

Edit: There's a good Wiki article here on the MS community Wiki http://social.technet.microsoft.com/wiki/contents/articles/22653.active-directory-ambiguous-name-resolution.aspx
1
 

Author Closing Comment

by:Dallas Smetter
ID: 41809675
Thank you!!!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

This article runs through the process of deploying a single EXE application selectively to a group of user.
This article outlines the process to identify and resolve account lockout in an Active Directory environment.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

839 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