VBScript Code to Verify Whether Attributes are Indexed and-or in the Global Catalog
You can use any of the VBScript programs below in ActiveXperts Network Monitor. Click here for an explanation about how to include scripts in ActiveXperts Network Monitor.
Example(s)
Const IS_INDEXED = 1
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=ADsDSOObject;"
Set objCommand = CreateObject("ADODB.Command")
objCommand.ActiveConnection = objConnection
objCommand.Properties("Sort On") = "isMemberOfPartialAttributeSet"
objCommand.CommandText = _
";" & _
"(objectClass=attributeSchema);" & _
"lDAPDisplayName, isMemberOfPartialAttributeSet,searchFlags;onelevel"
Set objRecordSet = objCommand.Execute
Do Until objRecordSet.EOF
WScript.Echo objRecordset.Fields("lDAPDisplayName")
If objRecordset.Fields("isMemberOfPartialAttributeSet")Then
WScript.Echo "In the global catalog."
Else
WScript.Echo "Not in the global catlog."
End If
If IS_INDEXED AND objRecordset.Fields("searchFlags") Then
WScript.Echo "Is indexed."
Else
WScript.Echo "Is not indexed."
End If
Wscript.Echo VbCrLf
objRecordSet.MoveNext
Loop
objConnection.Close
