Indexing Extension Attributes
f you want to increase the performance of LDAP searches against extension attributes, you can modify the AD or Exchange directory schema so that the directory will know to build an index.
March 28, 2004
If you want to increase the performance of Lightweight Directory Access Protocol (LDAP) searches against extension attributes, you need to modify the directory schema so the directory will know to build an index. The Microsoft article "XADM: Slow Response When Searching on Custom Attributes" describes the steps for modifying Microsoft Exchange Server 5.5 deployments. Basically, you need to change the Search-Flags attribute to one of three possible values: 0 (not indexed), 1 (indexed), or 2 (indexed for Ambiguous Name Resolution). ANR lets you locate objects based on partial information. You've probably seen examples of ANR in action when you've used Outlook to address an email message. When you type a few letters of a last name, such as Hew, Outlook uses ANR searches to locate Hewer, Hewlett, or Hewmon. You shouldn't need ANR for PINs, so the best option is to set the Search-Flags attribute to 1.
Exchange Server 2003 and Exchange 2000 Server use Active Directory (AD), and AD has a few more indexing options than the Exchange 5.5 directory. The Microsoft article "Setting an Attribute's searchFlags Property to Be Indexed for ANR" describes how to set AD's searchFlags attribute to be indexed for ANR. Although you don't need to index this field with ANR, this article provides an excellent step-by-step guide about how to modify the searchFlags attribute's value.
The searchFlags attribute values of 1 and 4 represent indexing and indexing with ANR, respectively. But you can't simply set the searchFlags value to 1. AD uses the value in this field to control other functions and operations. Changing this value to 1 might negatively impact the other functions or operations.
The searchFlags field is organized as a binary bitmap with each binary bit representing an on or off setting. Setting bit 1 to the value of 1 turns on indexing, so you need to add 1 to whatever number the attribute already has stored. For example, if the attribute already contains the value 16 (which in binary format is 10000), you would set the value to 17 (16 + 1 =17, which has a binary value of 10001). If you want indexing and ANR, you would set the value to 21 (16 + 4 + 1 = 21, which has the binary value of 10101). "Setting an Attribute's searchFlags Property to Be Indexed for ANR" provides more details and another example. In this article, Step 3 of the schema modification instructions tells you to "right-click the attribute you want to index." An example of an object you might right-click is CN=ms-Exch-Extension-Attribute-1. If you want information about what the values in the searchFlag field mean, go to the "Characteristics of Attributes" Web page.
About the Author
You May Also Like