4
votes

Can anyone help me with this ?

What I am trying to do is retrieve a distinct list of company from the AD using LDAP query. I wrote a query which returns all the company names, with duplicate values.

What I am trying to achieve is to get a list of distinct companies from AD.

My query for this is as given below.

DistinguishedName used is "ou=Users,o=rackspace"

And I am trying to filter it using the filter

Filter = "(company=*)"

Will you help me to get the list as I need it.

Thanks,

AR

1

1 Answers

2
votes

Sorry, but LDAP in its filter definitions does not support a 'distinct' function.

Your filter will only return object who have a company value populated, but it will return duplicates.

You will have to use something else, whether that is something coded, or even a simple Excel spreadsheet to get the distinct values.