Loading |
VBScript |
JavaScript |
Powershell |
Search Options: Search for Attributes in the Global CatalogContent of Search for Attributes in the Global Catalog.vbsMD5 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 :: |