Frends.LDAP.SearchObjects / 4.2.0
Summary
Searches the directory from a base with a scope and filter, and can page and cap results so a broad search does not fetch an entire directory.
Typical use — reconciling accounts against another system; the least-privilege habit is to fetch only the attributes actually needed
Input parameters.
| Name | Type | Default | Example | Description |
|---|---|---|---|---|
| SearchBase | String |
– | "ou=users,dc=wimpi,dc=net" |
The search base parameter specifies the DN of the entry where you want to begin the search. If you want the search to begin at the tree root pass an empty string. |
| Scope | Scopes |
– | Scopes.ScopeBase |
The search scope parameter specifies the depth of the search. Possible values:
|
| Filter | String |
– | (title=engineer) |
The search filter defines the entries that will be returned by the search. The LDAP search filter grammar is specified in RFC 2254 and 2251. The grammar uses ABNF notation. If you are looking for all employees with a title of engineer, the search filter would be (title=engineer). |
| MsLimit | Int32 |
0 |
0 |
The maximum time in milliseconds to wait for results. The default is 0, which means that there is no maximum time limit. |
| ServerTimeLimit | Int32 |
0 |
0 |
The maximum time in seconds that the server should spend returning search results. This is a server-enforced limit. The default of 0 means no time limit. |
| SearchDereference | SearchDereference |
DerefNever |
SearchConstraints.DerefNever |
Specifies when aliases should be dereferenced. DerefNever, DerefFinding, DerefAlways Possible values:
|
| MaxResults | Int32 |
1000 |
1000 |
The maximum number of search results to return. This acts as a hard limit—regardless of page size or batch size, no more than this number of results will be returned. Set to 0 for no limit. |
| BatchSize | Int32 |
100 |
1 |
This parameter controls the chunk size in which data will be read from the server. This does not affect the output result amount. |
| PageSize | Int32 |
500 |
1 |
Controls how many entries are requested from the server in a single page during a paged LDAP search. This directly affects how results are fetched from the server. If set to 0, paging is disabled and all entries are requested in a single operation (not recommended for large directories). |
| TypesOnly | Boolean |
False |
false |
If true, returns the names but not the values of the attributes found. If false, returns the names and values for attributes found. |
| ContentEncoding | ContentEncoding |
Default |
ContentEncoding.UTF8 |
Specifies the encoding of the content. Possible values:
|
| EnableBom | Boolean |
– | true |
Enable BOM in UTF-8 encoding. |
| ContentEncodingString | String |
– | windows-1251 |
Content encoding as string. |
| SearchOnlySpecifiedAttributes | Boolean |
True |
false |
Determine if only specified attributes should be returned. This allows user to specify encoding and type for certain attributes. |
| Attributes | Attributes[] |
– |
new Attributes[]
{
new Attributes { Key = "title", ReturnType = ReturnType.String },
new Attributes { Key = "objectGUID", ReturnType = ReturnType.Guid },
new Attributes { Key = "photo", ReturnType = ReturnType.ByteArray }
}
|
The names of attributes to retrieve. |