Can anyone point me to a resource that defines the maximum allowable length of the LDAP filter string in Active Directory?
According to the specification in RFC1558, there is not a hard limit imposed on the length of LDAP filter strings. Different implementations might have their own limits though.
How are you using the LDAP query?
Is it a direct query or are you using some wrapper class (such as those found in System.DirectoryServices within the .Net framework)? As this may have its own limitations above and beyond the LDAP protocol.
According to Technet: How Active Directory Searches Work, the maximum LDAP request size that the server attempts to process defaults to 10,485,760 bytes.
If the server receives a request that is larger than this value, it closes the connection. Hope that helps.
If you're using the AD Users and Groups GUI interface to contruct the query you are limited to 464 characters. If you're using dsquery from the command line you are not limited to 464 characters. I don't know the upper bounds for filter length on dsquery, but I assume it's inline with the LDAP spec.