Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 8.5   9.0   9.1   9.2   9.3   9.4   9.5   10.0   10.1   10.2    Statistic  


Performs a search.

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


Parameter Description Example value
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.
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 Optional
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.
Size Limit Optional
Limit on the number of entries to return from the search.
A value of zero indicates no limit.


Returns OK or error.


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.


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

Example Databases

Blog Entries

Release notes

  • Version 8.5
    • Changed how timeout is passed to LDAP.Search function.
  • Version 7.0
    • Fixed issue on Windows with LDAP.Search and using attribute list.

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

LDAP.Rename   -   LDAP.SearchResult.AttributeCount

Feedback: Report problem or ask question.

MBS Xojo Chart Plugins