This syntax is deprecated and you should use the new alias name: ldapUserAttr instead.
Description
Returns an array of the requested attribute. This is a LDAP search function. The second function syntax is more comfortable. Both get the LDAP record and shows the attribute of that user. Returned user must be unique, otherwise exception occurs.
Allowed attributes are (these are case sensitive):
- CN
- DN
- firstName
- lastName
- displayName
- title
- department
- division
- officeName (mapped on physicalDeliveryOfficeName attribute)
- company
- empID
- manager
- otherMailbox
- mobile
- homePhone
- workPhone
- userPrincipalName
- winPrincipalName
Parameters
Return Type
String []
The values of the specified attribute. If the attribute only has one value, the array will contain only one element, but will still be an array and not a single string.
Examples
Example
ldapUserRecord("mobile", user, "", "", "", "user"); //gets the mobile attribute from LDAP user with specified CN
OpenDS example
string email = ldapUserRecord("mail", "(&(uid=user.1)(objectClass=inetOrgPerson))"); string address = ldapUserRecord("postalAddress", "(&(uid=user.1)(objectClass=inetOrgPerson))");
LDAP must be configured. See LDAP configuration page.
Only Microsoft Active Directory is supported at this time, but it might work with other as well (tested with OpenDS). To provide support for other LDAP types contact us.
See also
We've encountered an issue exporting this macro. Please try exporting this page again later.