Читати англійською Редагувати

Поділитися через


DirectorySearcher Constructors

Definition

Initializes a new instance of the DirectorySearcher class.

Overloads

DirectorySearcher()

Initializes a new instance of the DirectorySearcher class with default values.

DirectorySearcher(DirectoryEntry)

Initializes a new instance of the DirectorySearcher class using the specified search root.

DirectorySearcher(String)

Initializes a new instance of the DirectorySearcher class with the specified search filter.

DirectorySearcher(DirectoryEntry, String)

Initializes a new instance of the DirectorySearcher class with the specified search root and search filter.

DirectorySearcher(String, String[])

Initializes a new instance of the DirectorySearcher class with the specified search filter and properties to retrieve.

DirectorySearcher(DirectoryEntry, String, String[])

Initializes a new instance of the DirectorySearcher class with the specified search root, search filter, and properties to retrieve.

DirectorySearcher(String, String[], SearchScope)

Initializes a new instance of the DirectorySearcher class with the specified search filter, properties to retrieve, and search scope.

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

Initializes a new instance of the DirectorySearcher class with the specified search root, search filter, properties to retrieve, and search scope.

DirectorySearcher()

Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs

Initializes a new instance of the DirectorySearcher class with default values.

C#
public DirectorySearcher();

Remarks

The following table shows the initial property values of the DirectorySearcher object.

Property Initial value
SearchRoot A null reference (Nothing in Visual Basic)
Filter "(objectClass=*)"
PropertiesToLoad An empty StringCollection object
SearchScope Subtree

See also

Applies to

.NET 10 (package-provided) та інші версії
Продукт Версії
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

DirectorySearcher(DirectoryEntry)

Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs

Initializes a new instance of the DirectorySearcher class using the specified search root.

C#
public DirectorySearcher(System.DirectoryServices.DirectoryEntry? searchRoot);
C#
public DirectorySearcher(System.DirectoryServices.DirectoryEntry searchRoot);

Parameters

searchRoot
DirectoryEntry

The node in the Active Directory Domain Services hierarchy where the search starts. The SearchRoot property is initialized to this value.

Remarks

The following table shows the initial property values of the DirectorySearcher object.

Property Initial value
Filter "(objectClass=*)"
PropertiesToLoad An empty StringCollection object
SearchScope Subtree

See also

Applies to

.NET 10 (package-provided) та інші версії
Продукт Версії
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

DirectorySearcher(String)

Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs

Initializes a new instance of the DirectorySearcher class with the specified search filter.

C#
public DirectorySearcher(string? filter);
C#
public DirectorySearcher(string filter);

Parameters

filter
String

The search filter string in Lightweight Directory Access Protocol (LDAP) format. The Filter property is initialized to this value.

Remarks

The following table shows the initial property values of the DirectorySearcher object.

Property Initial value
SearchRoot A null reference (Nothing in Visual Basic)
PropertiesToLoad An empty StringCollection object
SearchScope Subtree

See also

Applies to

.NET 10 (package-provided) та інші версії
Продукт Версії
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

DirectorySearcher(DirectoryEntry, String)

Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs

Initializes a new instance of the DirectorySearcher class with the specified search root and search filter.

C#
public DirectorySearcher(System.DirectoryServices.DirectoryEntry? searchRoot, string? filter);
C#
public DirectorySearcher(System.DirectoryServices.DirectoryEntry searchRoot, string filter);

Parameters

searchRoot
DirectoryEntry

The node in the Active Directory Domain Services hierarchy where the search starts. The SearchRoot property is initialized to this value.

filter
String

The search filter string in Lightweight Directory Access Protocol (LDAP) format. The Filter property is initialized to this value.

Remarks

The following table shows the initial property values of the DirectorySearcher object.

Property Initial value
PropertiesToLoad An empty StringCollection object.
SearchScope Subtree

See also

Applies to

.NET 10 (package-provided) та інші версії
Продукт Версії
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

DirectorySearcher(String, String[])

Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs

Initializes a new instance of the DirectorySearcher class with the specified search filter and properties to retrieve.

C#
public DirectorySearcher(string? filter, string[]? propertiesToLoad);
C#
public DirectorySearcher(string filter, string[] propertiesToLoad);

Parameters

filter
String

The search filter string in Lightweight Directory Access Protocol (LDAP) format. The Filter property is initialized to this value.

propertiesToLoad
String[]

The set of properties to retrieve during the search. The PropertiesToLoad property is initialized to this value.

Remarks

The following table shows the initial property values of the DirectorySearcher object.

Property Initial value
SearchRoot A null reference (Nothing in Visual Basic)
SearchScope Subtree

See also

Applies to

.NET 10 (package-provided) та інші версії
Продукт Версії
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

DirectorySearcher(DirectoryEntry, String, String[])

Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs

Initializes a new instance of the DirectorySearcher class with the specified search root, search filter, and properties to retrieve.

C#
public DirectorySearcher(System.DirectoryServices.DirectoryEntry? searchRoot, string? filter, string[]? propertiesToLoad);
C#
public DirectorySearcher(System.DirectoryServices.DirectoryEntry searchRoot, string filter, string[] propertiesToLoad);

Parameters

searchRoot
DirectoryEntry

The node in the Active Directory Domain Services hierarchy where the search starts. The SearchRoot property is initialized to this value.

filter
String

The search filter string in Lightweight Directory Access Protocol (LDAP) format. The Filter property is initialized to this value.

propertiesToLoad
String[]

The set of properties that are retrieved during the search. The PropertiesToLoad property is initialized to this value.

Remarks

The following table shows the initial property values of the DirectorySearcher object.

Property Initial value
SearchScope Subtree

See also

Applies to

.NET 10 (package-provided) та інші версії
Продукт Версії
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

DirectorySearcher(String, String[], SearchScope)

Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs

Initializes a new instance of the DirectorySearcher class with the specified search filter, properties to retrieve, and search scope.

C#
public DirectorySearcher(string? filter, string[]? propertiesToLoad, System.DirectoryServices.SearchScope scope);
C#
public DirectorySearcher(string filter, string[] propertiesToLoad, System.DirectoryServices.SearchScope scope);

Parameters

filter
String

The search filter string in Lightweight Directory Access Protocol (LDAP) format. The Filter property is initialized to this value.

propertiesToLoad
String[]

The set of properties to retrieve during the search. The PropertiesToLoad property is initialized to this value.

scope
SearchScope

The scope of the search that is observed by the server. The SearchScope property is initialized to this value.

Remarks

The following table shows the initial property values of the DirectorySearcher object.

Property Initial value
SearchRoot A null reference (Nothing in Visual Basic)

See also

Applies to

.NET 10 (package-provided) та інші версії
Продукт Версії
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

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

Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs
Source:
DirectorySearcher.cs

Initializes a new instance of the DirectorySearcher class with the specified search root, search filter, properties to retrieve, and search scope.

C#
public DirectorySearcher(System.DirectoryServices.DirectoryEntry? searchRoot, string? filter, string[]? propertiesToLoad, System.DirectoryServices.SearchScope scope);
C#
public DirectorySearcher(System.DirectoryServices.DirectoryEntry searchRoot, string filter, string[] propertiesToLoad, System.DirectoryServices.SearchScope scope);

Parameters

searchRoot
DirectoryEntry

The node in the Active Directory Domain Services hierarchy where the search starts. The SearchRoot property is initialized to this value.

filter
String

The search filter string in Lightweight Directory Access Protocol (LDAP) format. The Filter property is initialized to this value.

propertiesToLoad
String[]

The set of properties to retrieve during the search. The PropertiesToLoad property is initialized to this value.

scope
SearchScope

The scope of the search that is observed by the server. The SearchScope property is initialized to this value.

See also

Applies to

.NET 10 (package-provided) та інші версії
Продукт Версії
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10