VbsEdit, the award-winning VBScript editor that dramatically reduces the time you spend writing .VBS scripts

Sample scripts


Scripting Techniques
   ADSI
       Verify Whether Attributes are Indexed and-or in the Global Catalog , LDAP

' Verify Whether Attributes are Indexed and-or in the Global Catalog


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 = _
    "<LDAP://CN=Schema,CN=Configuration,DC=fabrikam,DC=com>;" & _
        "(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



VbsEdit includes all these samples!




Download Now!

Version 5.4.1 - This package includes VbsEdit 32-bit, VbsEdit 64-bit, HtaEdit 32-bit and HtaEdit 64-bit.
The evaluation version never expires.



Home

Copyright (C) 2001-2012 Adersoft