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
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.