.NET Framework Class Library  

DirectorySearcher Constructor (DirectoryEntry, String, String[], SearchScope)

Initializes a new instance of the DirectorySearcher class with the SearchRoot, Filter, PropertiesToLoad, and SearchScope properties set to the specified values.

[Visual Basic]
Public Sub New( _
   ByVal searchRoot As DirectoryEntry, _
   ByVal filter As String, _
   ByVal propertiesToLoad() As String, _
   ByVal scope As SearchScope _
)
[C#]
public DirectorySearcher(
   DirectoryEntry searchRoot,
   string filter,
   string[] propertiesToLoad,
   SearchScope scope
);
[C++]
public: DirectorySearcher(
   DirectoryEntry* searchRoot,
   String* filter,
   String* propertiesToLoad __gc[],
   SearchScope scope
);
[JScript]
public function DirectorySearcher(
   searchRoot : DirectoryEntry,
   filter : String,
   propertiesToLoad : String[],
   scope : SearchScope
);

Parameters

searchRoot
The node in the Active Directory hierarchy where the search starts. The SearchRoot property is initialized to this value.
filter
The search filter string in Lightweight Directory Access Protocol (LDAP) format. The Filter property is initialized to this value.
propertiesToLoad
The set of properties to retrieve during the search. The PropertiesToLoad property is initialized to this value.
scope
The scope of the search that is observed by the server. The SearchScope property is initialized to this value.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

DirectorySearcher Class | DirectorySearcher Members | System.DirectoryServices Namespace | DirectorySearcher Constructor Overload List | DirectoryEntry | Filter | PropertiesToLoad | DirectorySearcher.SearchScope | SearchScope | SearchRoot