Accessing IIndexDs Objects

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

Option Explicit 
On Error Resume Next 

Dim objSearchAdmin, objBuildServer, objCatalogs, objCatalog, objServers, objServer 

Set objSearchAdmin = CreateObject("Search.SearchAdmin.1") 
Set objBuildServer = objSearchAdmin.BuildServer 
Set objCatalogs = objBuildServer.BuildCatalogs 
Set objCatalog  = objCatalogs("KMSampleCatalog2")
Set objServers  = objCatalog.SearchServers

Wscript.Echo objCatalog.Name & " is propagated to:"

For Each objServer in objServers
  Wscript.Echo objServer.Name & " in directory " & objServer.PropDestination 
Next

'Release objects 
Set objServer   = Nothing 
Set objServers  = Nothing 
Set objCatalog  = Nothing 
Set objCatalogs = Nothing 
Set objBuildServer = Nothing 
Set objSearchAdmin = Nothing 
 

© 1997-1998 Microsoft Corporation. All rights reserved.