-2

In this OU=Employees,OU=Users,DC=org,DC=com I have a list of CN (user1, user2, user3. Each CN (user) contains a list of attributes (isUseless, managerid, etc.)

I want to obtain a list of all CN Employees, whos attribute isUseless=Yes.

I've searched all over the web and read countless tutorials, but am struggling to understand probably some basic concepts here. I would really apprecaite if someone could break down the solution for me.

Ugnius Malūkas
  • 2,649
  • 7
  • 29
  • 42
Loclat123
  • 1
  • 1

1 Answers1

0

A LDAP Search filter similar to:

(&(isUseless=Yes)(|(cn= user1)(cn= user1)(cn=user1)))

or for all entries with cn values: (&(isUseless=Yes)(cn=*)) or for all user type entries (in Microsoft Active Directory:

(&(isUseless=Yes)(sAMAccountType=805306368))

Specifying the: returned attributes: "isUseless" "managerid" "etc" baseDN: OU=Employees,OU=Users,DC=org,DC=com

Should do the trick.

Let me know how I can help. -jim

jwilleke
  • 10,467
  • 1
  • 30
  • 51
  • Hey Jim, I tried using this query, and repalced "user1" with the CN name, but still didn't work. In any case, is it possible to query across all CN instead of specific CN (users)? For example: (&(isUseless=Yes)(|(cn=*)) Is this suppose to return all CNs in OU=Employees which contain the attribute "isUseless=Yes"? – Loclat123 Apr 27 '18 at 22:40
  • The format `(&(isUseless=Yes)(objectClass=user))` worked for me. – Nyerguds Apr 24 '20 at 13:33