Can CFLDAP be used to extract all users from a distribution group with only the group email address?

I would like to use CFLDAP to retrieve all the users in the specific distribution group used by Exchange. If possible, what am I using for the filter attribute CFLDAP? Also, if I have an email address for the group (for example, " sales@example.com "), can I get user information or do I need the name of the group using this email address?

For example, what would I add to the block below?

<cfldap server = "foo.example.com" action = "query" name = "ldap2" start = "dc=foo,dc=example,dc=com" attributes = "givenName,sn,sAMAccountName,mail,employeeID,dn" filter="?????????????" username="BAR\eterps" password="12345" > 
+6
source share
3 answers

To get the group name from the email address, I used Active Directory Explorer. I am sure there is a way to request it as well.

As soon as I got the group name, I created my filter for CFLDAP: (& (objectclass = user) (memberOf = cn = Sales, ou = Email Distribution Groups, dc = foo, dc = example, dc = com))

Thus, the received CFLDAP request looks like this:

 <cfldap server = "foo.example.com" action = "query" name = "ldap2" start = "dc=foo,dc=example,dc=com" attributes = "givenName,sn,sAMAccountName,mail,employeeID,dn" filter="(&(objectClass=user)(memberOf=cn=Sales,ou=Email Distribution Groups,dc=foo,dc=example,dc=com))" username="BAR\eterps" password="12345" > 
+4
source

A filter is not required when using cfldap in my experience. What happens when you run a query without a filter?

0
source

If I understand your question correctly, you can change the start attribute using a specific dn group, and not just Root dn, it should only return information from this group. If there is an attribute pointing to users in this group, make sure you include them in the attribute list.

If you do not change the start attribute, your filter will look like ( cn=groupname ), which indicates the group you need.

0
source

Source: https://habr.com/ru/post/907072/


All Articles