I have a need to build an LDAP filter with a very lengthy OR condition, and am wondering if there may be a better way to do this.
Currently, the query string I am using is
There can be up to 200 or so users in this query string. The users in question are not in any particular LDAP group, nor have any other attributes in common; they are randomly distributed throughout the LDAP directory. My only way to identify those users I'm interested in is by their user ID. I also don't have control over the LDAP server, and can't create a user group (it would also not make much sense in this context).
Building this query string is tedious and error-prone, and I'm wondering if there might be a better way to do this.
More background information: the complete LDAP directory is very large, tens of thousands of users. The users in question have been selected to take a training class, and the classroom computers will only allow those selected to log on. The list of users (and therefore my filter) changes every few weeks.
The underlying implementation will be openldap on RedHat 7.