I am searching an LDAP directory that has a much larger number of results than the sizelimit currently set,500, by slapd.conf that for all intents and purposes cannot be changed)
My idea was to keep running ldapsearch but from a different offset each time (501, 1001, etc.) until all results have been obtained.
I have seen the man pages for ldapsearch, and it appears that this is handled for you using the -E options:
-E [!]<ext>[=<extparam>] search extensions (! indicates criticality) [!]domainScope (domain scope) [!]mv=<filter> (matched values filter) [!]pr=<size>[/prompt|noprompt] (paged results/prompt) [!]subentries[=true|false] (subentries) [!]sync=ro[/<cookie>] (LDAP Sync refreshOnly) rp[/<cookie>][/<slimit>] (LDAP Sync refreshAndPersist)
So i tried:
ldapsearch -h $HOST -p $PORT -x -L -b "$BASE" '*' '+' -E pr=$SIZE
However when the results (even paged results with size = 50 for example) hit 500, I get the same error as if the results were not paged:
Size limit exceeded (4)
I have seen in the man pages there is another option for virtuallistview but have been unable to find examples for it, and as well I dont think my version of ldapsearch has this option.
The goal here is to create a backup using ldapsearch and the -L option to create an ldif file that is suitable for restoring the database.
A few google searches show up with the same problem I'm having, but none have an applicable solution..