Partager via


ICatAdm::AddScope method

[Indexing Service is no longer supported as of Windows XP and is unavailable for use as of Windows 8. Instead, use Windows Search for client side search and Microsoft Search Server Express for server side search.]

Creates a new scope.

Syntax

HRESULT AddScope(
  [in]           BSTR         bstrScopeName,
  [in]           VARIANT_BOOL fExclude,
  [in, optional] VARIANT      vtLogon,
  [in, optional] VARIANT      vtPassword,
  [out, retval]  IDispatch    **pIDisp
);

Parameters

bstrScopeName [in]

The case-insensitive scope path to be created. This path must be unique for a given catalog and must represent a valid local path or a universal naming convention (UNC) path.

fExclude [in]

If VARIANT_TRUE, excludes this scope from indexing. If VARIANT_FALSE, enables indexing for this scope.

vtLogon [in, optional]

A string that represents the logon name.

vtPassword [in, optional]

A string that represents the logon password.

pIDisp [out, retval]

The new ScopeAdm object. See IScopeAdm.

Return value

This method can return one of these values.

Return code Description
ERROR_ALREADY_EXISTS
The path in bstrScopePath already is in use.
E_INVALIDARG
The logon and password values are included for local paths or the logon and password values are missing for UNC paths.

 

Remarks

The vtLogon and vtPassword parameters are optional. However, they are both required if the scope path is a UNC path. Neither parameter should be specified when the scope path is local.

Requirements

Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
End of client support
Windows 7
End of server support
Windows Server 2008 R2
DLL
Ciodm.dll

See also

ICatAdm