This method adds a site to the site restriction list.
Syntax
ISiteRestrictions.Add(SiteName, Included)
Parameters
SiteName
The name of the site to which the site rule applies.
Included
If True, Search crawls this site; if False, Search does not crawl this site.
Remarks
You must not supply the http:// prefix to the site name. If you have path restrictions that you want to specify for the site, you must first add the site, then apply the path restrictions (see the ISitePaths.Add method).
Example
The following example avoids the site Microsoft.com.
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
Set objCatalog = objCatalogs("KMSampleCatalog2")
Set objSites = objCatalog.objSites
objSites.Add "Microsoft.com", False
'Release objects
Set objSites = Nothing
Set objCatalog = Nothing
Set objCatalogs = Nothing
Set objBuildServer = Nothing
Set objSearchAdmin = Nothing
See Also