function
| Library: LDAP support (OMLDAP legacy) Include: omldap.xin | 
define external function ldapSearch
             value      ldapConnection connection
     base    value      stream         base
     scope   value      integer        scope      optional  initial { LDAP_SCOPE_ONELEVEL }
     where   value      stream         filter
     entry   modifiable ldapAttribute  entry
     format  value      integer        format     optional  initial { LDAP_FORMAT_VALUE }
     selects read-only  stream         attributes optional
     select  remainder  stream         attribute
Where:
Argument definitions
The ldapSearch function executes a search on the LDAP server specified by ldapConnection.
The following example searches one level deep from the base of "omnimark.com" in the RD department for the name, employee number, and phone number of whatever entry my-entry has been set to.
include "omldap.xin" process local ldapAttribute my-entry variable ... ldapSearch my-ldap base "o=omnimark.com" scope LDAP_SCOPE_ONELEVEL where"(Department=RD)" entry my-entry select "name" select "employeenumber" select "phonenumber"
These lines are part of a larger program that repeats over my-entry so that the information for all the employees in department RD is found and output.