I already searched a lot of pages on the web but did not find an answer yet. I need to query a MS Windows AD server with ldapsearch to get the users/accounts of a specific group. Therefore I try using a filter string similar to this:
(memberOf=CN=App-User,ou=Org Staff,dc=organization,dc=local)
In the base-DN the space between Org and Staff is no problem, but in the filter string. I tried many combinations of escaping the space but without success. Does anybody know how to get it working with space in OU or do we have to change the OU on the AD server? Many thanks in advance, Nico
Probably wou want to check if OU is really in memberOf with any AD browser such as NetTools. Generally you could achieve the required result in at least three ways:
By putting a filter in single or double quotes and leaving parts with spaces as is
Ex.
By putting a filter in quotes and values with spaces in double-quotes
Ex. (reduced for brevity)
By putting a filter in double-quotes and by masking any nested double-quotes
THESE WILL NOT WORK. Examples below are intentionally wrong