Previous in Contents Next in Contents

Creating and Accessing IIndexDs Interface Objects

You create a new IIndexDs interface object by calling the Add method. You can access a specific IIndexDs interface object by calling the Item property. Because ICatalogSearchServerList is a collection, you can access all IIndexDs interface objects using a for each loop, as in the following example, where objServer is the name you give to the IIndexDs interface object:

Option Explicit 
On Error Resume Next 

Dim objSearchAdmin, objBuildCatalog, objServer 

Set objSearchAdmin = CreateObject("Search.SearchAdmin.1") 

'Add MyTestMachine to KMSampleCatalog1
Set objBuildCatalog = _
  objSearchAdmin.BuildServer.BuildCatalogs.Item("KMSampleCatalog1")

Set objServer = objBuildCatalog.SearchServers.Add("MyTestMachine")

For Each objBuildCatalog IN objSearchAdmin.BuildServer.BuildCatalogs
  If objBuildCatalog.SearchServers.Count > 0 Then
    Wscript.Echo objBuildCatalog.Name _
      & " is propagated to the following Search hosts:"

    For Each objServer in objBuildCatalog.SearchServers
      Wscript.Echo "  " & objServer.Name & " in directory " _
        & objServer.PropDestination
    Next

    Wscript.Echo ""
  End If
Next
'Release objects 
Set objServer       = Nothing 
Set objBuildCatalog = Nothing 
Set objSearchAdmin  = Nothing 
 

© 1997-2000 Microsoft Corporation. All rights reserved.