Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 9.5   10.0   10.1   10.2   10.3   10.4   10.5   11.0   11.1   11.2    Statistic    FMM    Blog  

LDAP.Search

Performs a search.

Component Version macOS Windows Linux Server iOS SDK
LDAP 6.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ❌ No
MBS( "LDAP.Search"; LDAPRef; Base; Scope; Filter; Attributes; AttributesOnly { ; Timeout; Size Limit } )   More

Parameters

Parameter Description Example Flags
LDAPRef The reference number for the LDAP connection. $ldap
Base the distinguished name of the entry at which to start the search.
Scope Value to indicate the search scope. Can be:

Base: Search the base entry only.
OneLevel: Search all entries in the first level below the base entry, excluding the base entry.
Subtree: Search the base entry and all entries in the tree below the base.

On Mac can also be Children.
"Subtree"
Filter A text that specifies the search filter.
Attributes List indicating which attributes to return for each matching entry. "cn¶sn"
AttributesOnly Boolean value that should be 0 if both attribute types and values are to be returned, 1 if only types are required. 0
Timeout Timeout in seconds.
Specifies both the local search time-out value, in seconds, and the operation time limit that is sent to the server within the search request.
10 Optional
Size Limit Limit on the number of entries to return from the search.
A value of zero indicates no limit.
Optional

Result

Returns OK or error.

Description

Performs a search.
Searches the LDAP directory and returns a requested set of attributes for each matched entry.

On success, you can use LDAP.SearchResult.Count to find out the number of entries found.

Examples

Search for name:

MBS( "LDAP.Search"; $ldap; "dc=example,dc=com"; "Subtree"; "(sn=Jensen)")

Find entries with a givenName:

MBS("LDAP.Search"; $ldap; ""; "Subtree"; "(givenName=*)"; ""; 0; 20; 999)

See also

Release notes

Example Databases

Blog Entries

Created 15th December 2015, last changed 4th April 2019


LDAP.Rename - LDAP.SearchResult.AttributeCount

Feedback: Report problem or ask question.