How to use a filter to avoid a sub OU in Active Directory?

后端 未结 5 1529
清歌不尽
清歌不尽 2020-12-15 19:07

I have an application that pulls user information from an OU in Active Directory. The parameters it takes are a base for the search and a filter string.

I have an O

5条回答
  •  伪装坚强ぢ
    2020-12-15 19:34

    According to http://www.zytrax.com/books/ldap/apa/component.html, it's possible to get what you want using LDAP Component Filters. Here's an example that would match what you describe:

    (&(objectClass=organizationalUnit)(!(ou:dn:=Evil)))
    

    This matches all objects who have an objectClass of organizationUnit, but rejects anything whose DN contains a component that matches ou=Evil.

提交回复
热议问题