Modifying the Attributes Included with ANR
You want to modify the attributes that are included as part of ANR.
Using a graphical user interface
Using a command-line interface
You can include an attribute as part of ANR by using the ldifde utility and an LDIF file that contains the following:
dn: cn=rallencorp-LanguagesSpoken,cn=schema,cn=configuration,<ForestRootDN> changetype: modify replace: searchFlags searchFlags: 5 -
> ldifde -v -i -f add_anr_attr.ldf
You can also modify the searchFlags attribute using AdMod, as follows:
> admod b <AttributeDN> searchFlags::5
' This code will make an attribute part of the ANR set. ' ------ SCRIPT CONFIGURATION ------ ' Set to the common name (not LDAP display dame) of the attribute strAttrName = "<AttrCommonName>" ' e.g. rallencorp-LanguagesSpoken ' ------ END CONFIGURATION -------- set objRootDSE = GetObject("LDAP://RootDSE") set objAttr = GetObject("LDAP://cn=" & strAttrName & "," & _ objRootDSE.Get(" schemaNamingContext")) objAttr.Put "searchFlags", 5 objAttr.SetInfo WScript.Echo "New ANR attribute: " & strAttrName
ANR is an efficient search algorithm that allows for a complex search filter to be written using a single comparison. For example, a search for (anr=Jim Smith) would translate into the following query:
One requirement of any new ANR attribute is that the attribute must be also indexed. ANR searches are intended to be very fast, so if a nonindexed attribute were added to the set, it could dramatically impact the performance of the searches. Therefore, Active Directory requires that each added attribute be indexed.
You can use adfind with the stats+only switch to verify what the ANR expansion actually looks like. You can find out which attributes are included in the ANR set by using the following search criteria:
Alternatively, to find attributes that aren't included in ANR, change the previous search filter to the following:
Recipe 4.15 for modifying a bit flag attribute, Recipe 11.8 for adding a new attribute, MS KB 243299 (Ambiguous Name Resolution for LDAP in Windows 2000), and MS KB 243311 (Setting an Attribute's searchFlags Property to Be Indexed for ANR)