I am looking to filter out an OU. For example, I would like to filter out OU=Designers
OU=Designers,OU=Employees,DC=company,DC=com
I am using this ldap filter,
(&(objectCategory=person)(objectClass=user)(!(distinguishedName=CN=*,OU=Designers,OU=Employees,DC=company,DC=com)))
This is not working. Is there something I am missing here?
I tried an ldap filter but it is not working. I am looking to filter out an OU. Used this as reference – https://learn.microsoft.com/en-us/windows/win32/adsi/search-filter-syntax
sajed alam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
How about:
(&(objectClass=person)(!(OU=Designers)))
1
LDAP as a protocol does not support “wildcards” on distinguishedNames.
CN=*,OU=Designers,OU=Employees,DC=company,DC=com
And filters similer to
(&(objectClass=person)(!(OU=Designers)))
Will only work IF “OU=Designers” is added to the person entity’s themselves.
And unfortunately, Microsoft does not support Extensible Match, you could use do it like:
(&(objectClass=person)(!(ou:dn:=Designers)))
1