Directory Services |
The ADS_SCOPEENUM enumeration specifies the scope of a directory search.
typedef enum { ADS_SCOPE_BASE = 0, ADS_SCOPE_ONELEVEL = 1, ADS_SCOPE_SUBTREE = 2 } ADS_SCOPEENUM;
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.
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.
ADS_SEARCHPREF_INFO prefInfo; prefInfo.dwSearchPref = ADS_SEARCHPREF_SEARCH_SCOPE; prefInfo.vValue.dwType = ADSTYPE_INTEGER; prefInfo.vValue.Integer = ADS_SCOPE_SUBTREE;
Client: Included in Windows XP and
Windows 2000 Professional.
Server: Included in Windows Server 2003 and
Windows 2000 Server.
Redistributable: Requires Active Directory Client Extension
on Windows NT 4.0 SP6a and Windows 95/98/Me.
Header: Declared in Iads.h.