Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  Search  for  Attributes  in  the  Global  Catalog  

 Content of Search for Attributes in the Global Catalog.vbs
MD5 Hash: B3701A0891BA872C8FBEC396D6C98694
' Description: Demonstration script that returns the names of the attributes that are found in the global catalog, and indicates whether those attributes are indexed.


On Error Resume Next

Const IS_INDEXED = 1
Const ADS_SCOPE_SUBTREE = 2

Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=ADsDSOObject;"
Set objCommand = CreateObject("ADODB.Command")
objCommand.ActiveConnection = objConnection
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.CommandText = _
"SELECT lDAPDisplayName,isMemberOfPartialAttributeSet,searchFlags " _
& "FROM 'LDAP://CN=Schema,CN=Configuration,DC=fabrikam,DC=com'"_
& " WHERE objectClass='attributeSchema'"
Set objRecordSet = objCommand.Execute

Do Until objRecordSet.EOF
WScript.Echo objRecordset.Fields("lDAPDisplayName")
If objRecordset.Fields("isMemberOfPartialAttributeSet") Then
WScript.Echo "In the global catalog."
End If
If IS_INDEXED AND objRecordset.Fields("searchFlags") Then
WScript.Echo "Indexed."
End If
Wscript.Echo
objRecordSet.MoveNext
Loop
objConnection.Close

   © 2008 - 2013 Boris Toll      :: Scripts available: 6.481 ::      :: scriptbox.toll.at ::      :: powered by www.toll.at ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a