ajLDAPUserList function
Description
The ajLDAPUserList function retrieves a list of users from a LDAP directory which match the filter criteria.
Syntax
ajLDAPUserList(attributes, [filter], [ldap_source_id], [run_condition], [run_by_function_point_only])
Argument Name | Argument Type | Description |
---|---|---|
attributes (mandatory) | Range / Array | The cell range that contains a list of attributes to be retrieved. Refer to the documentation of your LDAP server for the attributes it supports. |
filter (optional) | String | The filter condition to retrieve the information. For example, "description = *sq* will search the records with description that contains "sq" in it. For details of how to use LDAP filter, please search for "LDAP filter" on the internet. |
ldap_source_id (optional) | String | The LDAP source id defined in worksheet ##ExternalResources. The default value is "primary". |
run_condition (optional) | Boolean | The function will run when the value is TRUE. Otherwise, it will not run. The default value is TRUE. |
run_by_function_point_only (optional) | Boolean | If it equals FALSE, the function can be executed through ‘Excel Calculation’ (can be either Automatic or Manual, Calculate Now or Calculate Sheet) or Preview Function Point. If it equals TRUE, the function can be executed with Preview Function Point (AlchemyJ ribbon \ Preview Function Point) only. The default value is TRUE. |
The function will return:
1) Return Value: Table records in array format.
2) Return Type: Single Value / Multiple values (array formula)
Example
In the External Resources Definition, create a new LDAP connection record in the LDAP Connection table.
Once it is created, we can proceed to test this function.
Do remember to copy the formula in Cell B10 and make into a cell array formula across the required cells. In this case, it is made into a cell array formula across cells C11:F14. As you can see from the example above, after running the function point, it returns the LDAP user list.
Click here to download the use case workbooks for further reference.
Error Scenarios
It will return #VALUE! when missing any required parameter or mismatch parameter type. Besides, system will raise error for below scenario(s).
Error Scenario |
---|
Attributes does not exist in LDAP server. |
Attributes is not a single row range or a single column range. |
Base path In LDAP connection is empty. |
External Resources Worksheet does not exist. |
Failed to login LDAP server. |
Invalid filter option. |
Invalid ldap source id. |
User ID is empty. |