Skip to content

ExecuteLdapQuery

Executes a search on the specified rootDN or host and returns the array of LDAP entries.

1
$Domain.ExecuteLdapQuery(rootDnOrHost: string, attributes: string, filter: string, username: string, password: string):Array<object>

Parameters

string rootDnOrHost
    The root DN (Distinguished Name) or host name to search.

string attributes
    The attributes to return. Optional.

string filter
    The filter for the search. Optional.

string username
    The username to authenticate with. Optional.

string password
    The password to authenticate with. Optional.

Returns

An array of LDAP entries.

Remarks

Before calling this method, LDAP connection settings must be configured in the application settings.

Example

1
2
3
4
var entries = $Domain.ExecuteLdapQuery('dc=example,dc=com', 'cn,mail', '(&(objectClass=user)(cn=*))');
for (var i = 0; i < entries.length; i++) {
   console.log(entries[i].cn + ' - ' + entries[i].mail);
}