DirectorySearcher.SearchScope

The SearchScope property gets or sets the scope of the search that is observed by the server.

public SearchScope SearchScope {get; set;}
Public Property SearchScope As SearchScope

Property Value

One of the SearchScope values. The default is Subtree.

Exceptions

Exception type Condition
InvalidEnumArgumentException The value is not one of the ReferralChasingOption values.

Remarks

The following table shows the SearchScope values.

Value Description
Base Limits the search to the base object. The result contains at most one object.
OneLevel Searches one level of the immediate children, excluding the base object.
Subtree Searches the whole subtree, including all children and the base object itself.

For more information on these values, see SearchScope.

Requirements

Client Requires Windows XP Home Edition, Windows XP Professional, Windows Me, or Windows 98.
Server Requires Windows Server 2003, Windows 2000, or Windows NT 4.0.
Namespace

Defined in System.DirectoryServices.

Assembly

Requires System.DirectoryServices (in System.DirectoryServices.dll).

.NET Framework

Requires .NET Framework 1.0.

See Also

DirectorySearcher, DirectorySearcher Constructors, DirectorySearcher Methods, DirectorySearcher Properties, SearchScope Enumeration, System.DirectoryServices Namespace, DirectorySearcher Members (Visual J# Syntax), Managed Extensions for C++ Programming