$Domain.ExecuteLdapQuery

Overview

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

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

Arguments

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

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

Copyright © 2010 - 2023 Emakin. All rights reserved.