Get the list of members for LDAP group

I have a question in regards to LDAP, or specifically LDAP.Client package. I’d like to list all the members of specific LDAP group but I cannot make it working with the package. If I enter into bash below code I’m getting a list of members attached to the group

/usr/bin/ldapsearch -LLL -x -h ldap.mycompany.com -s sub -b 'ou=Groups,o=mycompany.com' '(cn=my_ldap_group_to_list_members)' memberuid

I’d like to replicate the same in Julia but cannot succeed, do you have any hint on how to do it in Julia?

Your ldapsearch command uses anonymous mode. This was recently implemented in LDAPClient.jl, so something like the following should work:

using LDAPClient

server = "ldap://ldap.mycompany.com"
base = "ou=Groups,o=mycompany.com"
filter = "(cn=my_ldap_group_to_list_members)"

conn = LDAPClient.LDAPConnection(server)
LDAPClient.simple_bind(conn)
res = LDAPClient.search(conn, base, LDAPClient.LDAP_SCOPE_SUBTREE; filter)
for entry in LDAPClient.each_entry(res)
    println(entry["memberuid"])
end
LDAPClient.unbind(conn)