ajLDAPGroupMembers function
Description
The ajLDAPGroupMembers function retrieves the list of user or sub-groups in a group from a LDAP directory.
Syntax
ajLDAPGroupMembers(attributes, group_name, [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. |
group_name (mandatory) | String | The LDAP group name. |
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 | 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 B11 and make into a cell array formula across the required cells. In this case, it is made into a cell array formula across cells C12:F15. As you can see from the example above, after running the function point, it returns the list of group members under the LDAP Internal Dev Team group .
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. |
Group name is empty. |
Invalid filter option. |
Invalid ldap source id. |
Failed to connect to LDAP server. |