![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | ADSI and Searching Indexed Attributes I'm reading the Microsoft Windows 2000 Scripting Guide so I can learn to script. Multiple times it says to optimize your search, use indexed criteria and naturally these same references are made on the MSDN site. I understand why I'd want to search indexed entries but it makes it sound like I have a choice. For example, if I need to search AD for all objects with an attribute value of "Windows Server*", aren't I only going to get this from one attribute, "operatingSystem"? Either that attribute is indexed or it's not (I don't know off hand). It's not like I can search another attribute that IS indexed that'll have that same information - or is there? I certainly didn't see one in ADSI Edit. I really don't see any information that is duplicated in another attribute. This advice really doesn't seem helpful unless I have the authority to change the schema and index an attribute - perhaps that's the point. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: ADSI and Searching Indexed Attributes Larry wrote: Quote: > I'm reading the Microsoft Windows 2000 Scripting Guide so I can learn to > script. Multiple times it says to optimize your search, use indexed > criteria > and naturally these same references are made on the MSDN site. > > I understand why I'd want to search indexed entries but it makes it sound > like I have a choice. For example, if I need to search AD for all objects > with an attribute value of "Windows Server*", aren't I only going to get > this > from one attribute, "operatingSystem"? Either that attribute is indexed or > it's not (I don't know off hand). It's not like I can search another > attribute that IS indexed that'll have that same information - or is > there? I > certainly didn't see one in ADSI Edit. I really don't see any information > that is duplicated in another attribute. > > This advice really doesn't seem helpful unless I have the authority to > change the schema and index an attribute - perhaps that's the point. attribute is not indexed. The most common example where it matters is objectCategory vs. objectClass. The former is indexed, the latter is not. The systemFlags property of attribute objects (in the Schema container of AD) indicates if the attribute is indexed (among other settings). The systemFlags property is a flag attribute where you use a bit mask to tell if the appropriate bit is set (similar to userAccountControl). Several bit masks are used with this property. Unfortunately, this generally makes it difficult to tell which bits are set. A VBScript example to tell if a specific attribute is indexed would be as follows: ========== Const IS_INDEXED = 1 Set objAttribute = GetObject("LDAP://cn=Operating-System,cn=Schema,cn=Configuration,dc=MyDomain,dc=com") intSysFlags = objAttribute.systemFlags If ((intSysFlags And IS_INDEXED) <> 0) Then Wscript.Echo "The attribute is indexed" Else Wscript.Echo "The attribute is NOT indexed" End If ========== In this case, because the bit mask is 1, any odd value for systemFlags means the attribute is indexed. Any even value means the attribute is NOT indexed. The value of systemFlags for the Operating-System attribute is 16. You can view this with ADSI Edit or ldp in the Schema container of the Configuration container of your AD. -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
| | #3 (permalink) |
| | Re: ADSI and Searching Indexed Attributes Thanks for the confirmation. "Richard Mueller [MVP]" wrote: Quote: > Larry wrote: > Quote: > > I'm reading the Microsoft Windows 2000 Scripting Guide so I can learn to > > script. Multiple times it says to optimize your search, use indexed > > criteria > > and naturally these same references are made on the MSDN site. > > > > I understand why I'd want to search indexed entries but it makes it sound > > like I have a choice. For example, if I need to search AD for all objects > > with an attribute value of "Windows Server*", aren't I only going to get > > this > > from one attribute, "operatingSystem"? Either that attribute is indexed or > > it's not (I don't know off hand). It's not like I can search another > > attribute that IS indexed that'll have that same information - or is > > there? I > > certainly didn't see one in ADSI Edit. I really don't see any information > > that is duplicated in another attribute. > > > > This advice really doesn't seem helpful unless I have the authority to > > change the schema and index an attribute - perhaps that's the point. > You are correct that you usually have no choice. The operatingSystem > attribute is not indexed. The most common example where it matters is > objectCategory vs. objectClass. The former is indexed, the latter is not. > > The systemFlags property of attribute objects (in the Schema container of > AD) indicates if the attribute is indexed (among other settings). The > systemFlags property is a flag attribute where you use a bit mask to tell if > the appropriate bit is set (similar to userAccountControl). Several bit > masks are used with this property. Unfortunately, this generally makes it > difficult to tell which bits are set. A VBScript example to tell if a > specific attribute is indexed would be as follows: > ========== > Const IS_INDEXED = 1 > > Set objAttribute = > GetObject("LDAP://cn=Operating-System,cn=Schema,cn=Configuration,dc=MyDomain,dc=com") > intSysFlags = objAttribute.systemFlags > If ((intSysFlags And IS_INDEXED) <> 0) Then > Wscript.Echo "The attribute is indexed" > Else > Wscript.Echo "The attribute is NOT indexed" > End If > ========== > In this case, because the bit mask is 1, any odd value for systemFlags means > the attribute is indexed. Any even value means the attribute is NOT indexed. > The value of systemFlags for the Operating-System attribute is 16. You can > view this with ADSI Edit or ldp in the Schema container of the Configuration > container of your AD. > > -- > Richard Mueller > MVP Directory Services > Hilltop Lab - http://www.rlmueller.net > -- > > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| ADSI attributes Case Sensitve | PowerShell | |||
| Searching for files by attributes | Vista file management | |||
| disabling non-indexed searching in instant search | Vista file management | |||
| Searching within non-indexed files. | Vista General | |||
| Searching within non-indexed files. | Vista file management | |||