Skip to content

ExecuteLdapQuery

Executes a search on 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
    Root DN or host name to search.

string attributes
    Attributes to return. Optional.

string filter
    Filter of search. Optional.

string username
    Username to authenticate. Optional.

string password
    Password to authenticate. Optional.

Returns

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);
}