For the complete documentation index, see llms.txt. This page is also available as Markdown.

SearchObjects

Search objects from Active Directory.

Task version: 4.2.0

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Source code: https://github.com/FrendsPlatform/Frends.LDAP

Task Parameters

Name
Description

SearchBase : String

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.

Default: - Example: "ou=users,dc=wimpi,dc=net"

Scope : Scopes

The search scope parameter specifies the depth of the search.

Possible values:

  • ScopeBase: The search scope parameter specifies the depth of the search.

  • ScopeOne: The search scope parameter specifies the depth of the search.

  • ScopeSub: The search scope parameter specifies the depth of the search.

Default: - Example: Scopes.ScopeBase

Filter : String

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).

Default: - Example: (title=engineer)

MsLimit : Int32

The maximum time in milliseconds to wait for results. The default is 0, which means that there is no maximum time limit.

Default: 0 Example: 0

ServerTimeLimit : Int32

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.

Default: 0 Example: 0

SearchDereference : SearchDereference

Specifies when aliases should be dereferenced.

DerefNever, DerefFinding, DerefAlways

Possible values:

  • DerefNever: Specifies when aliases should be dereferenced.

DerefNever, DerefFinding, DerefAlways

  • DerefSearching: Specifies when aliases should be dereferenced.

DerefNever, DerefFinding, DerefAlways

  • DerefFinding: Specifies when aliases should be dereferenced.

DerefNever, DerefFinding, DerefAlways

  • DerefAlways: Specifies when aliases should be dereferenced.

DerefNever, DerefFinding, DerefAlways

Default: 0 Example: SearchConstraints.DerefNever

MaxResults : Int32

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.

Default: 1000 Example: 1000

BatchSize : Int32

This parameter controls the chunk size in which data will be read from the server. This does not affect the output result amount.

Default: 100 Example: 1

PageSize : Int32

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).

Default: 500 Example: 1

TypesOnly : Boolean

If true, returns the names but not the values of the attributes found.

If false, returns the names and values for attributes found.

Default: False Example: false

ContentEncoding : ContentEncoding

Specifies the encoding of the content.

Possible values:

  • UTF8: Specifies the encoding of the content.

  • Default: Specifies the encoding of the content.

  • ASCII: Specifies the encoding of the content.

  • WINDOWS1252: Specifies the encoding of the content.

  • Other: Specifies the encoding of the content.

Default: 1 Example: ContentEncoding.UTF8

EnableBom : Boolean

Enable BOM in UTF-8 encoding.

Default: - Example: true

ContentEncodingString : String

Content encoding as string.

Default: - Example: windows-1251

SearchOnlySpecifiedAttributes : Boolean

Determine if only specified attributes should be returned.

This allows user to specify encoding and type for certain attributes.

Default: True Example: false

Attributes : Attributes[]

The names of attributes to retrieve.

Default: - Example: new Attributes[] { new Attributes { Key = "title", ReturnType = ReturnType.String }, new Attributes { Key = "objectGUID", ReturnType = ReturnType.Guid }, new Attributes { Key = "photo", ReturnType = ReturnType.ByteArray } }

Name
Description

Host : String

LDAP server host.

This can be a domain name, LDAP alias, or a Domain Controller FQDN.

Default: - Example: emea.company.com

Port : Int32

Port. Value 0 = use LDAP/LDAPS default port which is 389 or 636 depending on (SecureSocketLayer) and (TLS).

Default: 0 Example: 389

SecureSocketLayer : Boolean

Perform secure operation.

Default: - Example: true

IgnoreCertificates : Boolean

Ignore server certificates

Default: False Example: true

TLS : Boolean

Connection is protected by TLS.

Default: - Example: true

LDAPProtocolVersion : LDAPVersion

Used LDAP protocol version.

Warning: LDAPv2 is deprecated and has security vulnerabilities. Use LDAPv3 unless absolutely required.

Possible values:

  • V2: Used LDAP protocol version.

Warning: LDAPv2 is deprecated and has security vulnerabilities. Use LDAPv3 unless absolutely required.

  • V3: Used LDAP protocol version.

Warning: LDAPv2 is deprecated and has security vulnerabilities. Use LDAPv3 unless absolutely required.

Default: 1 Example: LDAPVersion.V3

AnonymousBind : Boolean

If enabled credentials are not used to create a bind to the LDAP server.

Default: False Example: true

User : String

User.

Default: - Example: Foo

🗝Password : String

Password.

Default: - Example: Bar123

ThrowExceptionOnError : Boolean

If enabled Task throws an exception when LDAP error happens.

Default: False Example: true

Task Result

Name
Description

Success : Boolean

Search completed. Example: true

Error : String

LDAP Error message. Example: Entry Already Exists

SearchResult : List<SearchResult>

Results. Example: { AttributeSet { Key = "sn", Value = "Bar" }, DistinguishedName = "CN=Foo Bar,ou=users,dc=wimpi,dc=net" }

Task Changelog

Changelog for Task Frends.LDAP.SearchObjects.

[4.2.0] - 2026-02-03

Changed

  • Improved documentation for Host parameter usage

[4.1.0] - 2025-06-17

Added

  • Improved LDAP error handling by validating bind status and checking search response codes.

  • Block negative values for MsLimit

[4.0.0] - 2025-04-04

Added

  • [Breaking] - Parameter for PageSize to control how many entries are fetched per page during an LDAP search.

  • Default value for the new parameter:

    • PageSize: 500

  • If you want the Task to work exactly as before (non-paged search), set PageSize = 0.

  • Default paging behavior (PageSize = 500) may improve performance on large result sets, but changes how results are retrieved from the server.

[3.1.0] - 2025-04-01

Added

  • Added example values for new parameters.

[3.0.0] - 2025-03-17

Added

[Breaking]

  • Updated to version 3.0.0 with enhanced LDAP search capabilities.

  • Added support for selecting custom attributes, allowing users to receive attribute values as either text, byte array or Guid.

  • Introduced new encoding options�including BOM support and various encoding choices�for improved handling of search results.

  • Enabled an option to return only specified attributes, enhancing control over the output.

  • Added functionality to handle photo attributes in LDAP entries.

  • Enhanced flexibility in specifying content encoding for search results.

  • New methods and properties for improved search input handling and attribute retrieval.

  • Changed the Result object to be a dictionary of string, object to allow for more flexibility in the output.

Upgrade Instructions

  • Task's default values for new and changed parameters are configured to match the previous behavior. If you want to use the new functionality, you will need to update the parameters accordingly.

    • 'SearchOnlySpecifiedAttributes' parameter defaults to true which was the previous behavior. If you just want to specify certain attributes' types, set it to false. If not enabled the non specified attributes will be returned as string typed.

    • 'ContentEncoding' parameter defaults to the Agent's default encoding. If you want to use a different encoding, set it to the desired encoding.

  • Task's output has been updated to reflect the new Result object structure. This will have impact on how the Result object can be manipulated in other elements.

[2.1.0] - 2025-01-02

Fixed

  • Fixed issue with AttributeSet not having all values that were returned from LDAP search.

[2.0.0] - 2024-11-06

Added

  • [Breaking] Parameter for AnonymousBind to enable to connect without credentials.

  • [Breaking] Parameter for LDAPProtocolVersion to choose what LDAP version should be used.

  • Default values for new parameters are:

    • AnonymousBind: false

    • LDAPProtocolVersion: 3

  • Use the default parameters if you want the Task to work as before.

  • Check for Filter parameter that it's not empty and set null to it if it is so that the library sets objectClass=* as the filter.

[1.0.0] - 2022-10-03

Added

  • Initial implementation

Last updated

Was this helpful?