Friday, April 27, 2007

Microsoft has added a new LDAP feature to AD in Windows 2003 SP2 and Longhorn server called the LDAP_MATCHING_RULE_IN_CHAIN.  Essentially, it is an extension filter type that allows you to search withing the content of a distinguished name-syntax attribute and do matching throughout the entire chain of linked values instead of just within the immediate values.  The docs are here and the syntax looks like this:

(memberOf:1.2.840.113556.1.4.1941:=CN=some group,CN=xxxx,DC=xxxx,DC=xxxx)

I showed some examples of this in my talk at DEC where I used some searches with and without the extension filter type to show traversal of some nested group membership.

Ryan also wrote about this a while ago and discovered that while useful, this technique is very slow for expanding group membership and it seems to be much faster to just use recursive searches.

As it turns out, the problem is that we were trying to use this feature incorrectly.  The "In Chain" filter type should NOT be used for transitive link expansion!  It is intended to be used for matching only.  Perhaps that's why they called it LDAP_MATCHING_RULE_IN_CHAIN.  :)

As such, you should really only use it in a base level query.  If you use the filter shown above in a base level query, it will still tell you if the object that is used as the search root is a member of the specified group anywhere in the nesting chain, but it will perform fine.  If you use it for anything else, you are asking for trouble. 

Now, when will we get some sort of transitive link expansion widget that actually works well for this purpose?

Friday, April 27, 2007 2:24:21 PM (Central Daylight Time, UTC-05:00)  #    Comments [2]  |  Tracked by:
"DEC 2007 Follow Up" (Joe Kaplan) [Trackback]

Friday, April 27, 2007 8:37:50 PM (Central Daylight Time, UTC-05:00)
Careful Joe - It is not an incorrect usage to scope with a subtree filter. You just need to be cognizant of the performance hit. If you read the MSDN documents, even they will show an example of using a subtree scope filter to find a user's groups (transitively). If you are really concerned about performance, then this might not be right for you. However, given certain situations, this filter might be a perfect fit. Just be sure to scope it correctly (as low as you can go).
Saturday, April 28, 2007 2:02:37 AM (Central Daylight Time, UTC-05:00)
I suppose it depends on whether you believe Dmitri or the documentation. :) I think it is fair to say that if it used for anything other than a base query, the performance will not be very good. As to whether or not that is misuse or not...
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Theme design by Jelle Druyts