I am generating an LDAP query for Exchange Mailbox Management. The current query returns all mailbox-enabled users and then filters specific groups and individual users via the '!' operator. Now I need to change this to also filter for any users that are within a particular container or OU. I've been searching around and have not found a decent way of doing this. I've tried using the distinguished name with a wildcard (i.e. distinguishedName=CN=*,OU=MyOU,DC=Domain,DC=TLD).
Does anyone have any ideas?