__MIDL___MIDL_itf_ads_0000_0000_0021 Enumeration

The ADS_SCOPEENUM enumeration specifies the scope of a directory search.

Syntax

typedef enum __MIDL___MIDL_itf_ads_0000_0000_0021 {
  ADS_SCOPE_BASE      ,
  ADS_SCOPE_ONELEVEL  ,
  ADS_SCOPE_SUBTREE
} ADS_SCOPEENUM;

Constants

ADS_SCOPE_BASE Limits the search to the base object. The result contains, at most, one object.
ADS_SCOPE_ONELEVEL Searches one level of the immediate children, excluding the base object.
ADS_SCOPE_SUBTREE Searches the whole subtree, including all the children and the base object itself.

Remarks

If you do not explicitly set the search scope, the default is ADS_SCOPE_SUBTREE.

Because VBScript cannot read data from a type library, VBScript applications do not recognize the symbolic constants as defined above. Use the numerical constants, instead, to set the appropriate flags in your VBScript applications. To use the symbolic constants as a good programming practice, create explicit declarations of such constants, as done here, in your VBScript applications.

Examples

Search scope is one of the search preferences clients can specify. The following code example shows how to accomplish this using the ADS_SEARCHPREF_INFO structure, together with the elements defined in the ADS_SEARCHPREF_ENUM and this enumeration.

C++
ADS_SEARCHPREF_INFO prefInfo;
prefInfo.dwSearchPref = ADS_SEARCHPREF_SEARCH_SCOPE;
prefInfo.vValue.dwType = ADSTYPE_INTEGER;
prefInfo.vValue.Integer = ADS_SCOPE_SUBTREE;

Requirements

   
Windows version Windows Vista Windows Server 2008
Header iads.h

See Also

ADSI Enumerations

ADS_SEARCHPREF_ENUM

ADS_SEARCHPREF_INFO