SetAccount Method

This method sets the account through which Search accesses a site contents.

Syntax

ISiteResriction.SetAccount(Name, Password, AuthenticationType)

Parameters

Name

The account name under which Search accesses a site. This parameter sets the AccountName property for this restricted site.

Password

The password for this account.

AuthenticationType

The type of authentication that Search uses to access this site. This parameter sets the AuthenticationType property for this restricted site.

Remarks

The types of authentication are:

Name Value Description
AUTH_TYPE_ANONYMOUS 0 Use anonymous login (default).
AUTH_TYPE_NTLM 1 Use NT challenge-and-response login.
AUTH_TYPE_BASIC 2 Use basic (clear text) login.

Example

The following example accesses the MyLocalWeb.com site as user AdminTest with the password HelpMeMrWizard, using NT challenge-and-response authentication.

Option Explicit 
On Error Resume Next

Const AUTH_TYPE_NTLM = 1

Dim objSearchAdmin, objBuildServer, objCatalogs, objCatalog, objSites, objSite 

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

Set objSite   = objSites.Item("MyLocalWeb.com")

objSite.SetAccount "AdminTest", "HelpMeMrWizard", AUTH_TYPE_NTLM

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

See Also

AccountName


© 1997-1998 Microsoft Corporation. All rights reserved.