Count Property

This read-only property specifies the number of sites in the site restriction list.

Syntax

ISiteRestrictions.Count

Example

The following example displays the number of sites in the site restriction list for all catalogs.

Option Explicit 
On Error Resume Next 

Dim objSearchAdmin, objBuildServer, objCatalogs, objCatalog, objSites 

Set objSearchAdmin = CreateObject("Search.SearchAdmin.1") 
Set objBuildServer = objSearchAdmin.BuildServer 
Set objCatalogs = objBuildServer.BuildCatalogs 

For Each objCatalog in objCatalogs
  Set objSites  = objCatalog.objSites 
  Wscript.Echo objCatalog.Name & " has " & objSites.Count " 
    & " sites in its site restriction list."
Next

'Release objects 
Set objSite     = Nothing 
Set objSites    = Nothing 
Set objCatalog  = Nothing 
Set objCatalogs = Nothing 
Set objBuildServer = Nothing 
Set objSearchAdmin = Nothing 
 

See Also

Add, ISiteRestriction, Remove


© 1997-1998 Microsoft Corporation. All rights reserved.