objectClass vs. objectCategory

9/15/2007 8:14:00 PM

Everyone knows (or should) that in general, searching by objectClass is a "bad thing", e.g (objectClass=user). Why? because objectClass is not indexed, and otherwise unqualified searches will touch every single object in the search scope. Fine for NetPro's AD, but not fine for NIH's, or the Korean Government's.

The better answer is to search by objectCategory, which is single-valued and IS indexed. It can make for an astounding improvement in search times.

But a question I've had for a while is "what is the relationship between objectClass and objectCategory?" Most of the time, the value for objectCategory is simply the most specific value of the objectClass attribute. For instance, a computer object has a multi-valued objectClass of "top;person;organizationalPerson;user;computer" and its objectCategory is "computer". But a user object has an obejctClass value of "top;person;organizationalPerson;user", and its objectCategory is "person". What's up with that?

It turns out the AD schema contains the mapping of objectClass to objectCategory. Each classSchema object contains an attribute named "defaultObjectCategory". This is the value that is inserted into an object at creation time if no value for objectCategory is specified. It is possible that some particular piece of code will assign a different value for objectCategory, possibly unrelated to its objectClass, but this doesn't seem to be the case in practice.

See Search Filters on MSDN.

Related posts

Comments

10/17/2007 12:25:04 PM

Great post Gil - just remember that you'll also need to filter by something in the Security-Principal class if you want to avoid getting Contact records back!
Post back from 1dent1ty cHa0s:
www.identitychaos.com/.../...s-objectcategory.html

Brad Turner us

9/22/2008 1:42:56 AM

Wow objectClass vs. objectCategory

furnace filters us

12/17/2008 8:59:00 PM

i really like this blog..thanks for the info..i totally appreciate this..

Busby SEO Test us

Add comment


 

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

1/7/2009 5:39:33 AM

Powered by BlogEngine.NET 1.3.1.0
Theme by Mads Kristensen

Search

Professional

Quest logo TEC 2009 logo MVP logo

Social

Plaxo LinkedIn Facebook Twitter

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2009