Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
144 views
in Technique[技术] by (71.8m points)

c# - LDAP SearchRequest PageLimit - pagination?

I'm facing problem with maximum result size which is 1000 on server. I have to get more than 50000 groups.

I don't have any criteria to filter, even the stupidiest ideas like making pagination by querying groups from A-Z wont work, because i can have > 1000 groups which are beggining with character 'a'. We've got much organizational units, but also there are more than 10 000 in single OU.

searchBase : $"OU={ou},{searchBase}";
            var searchRequest = new SearchRequest(
                distinguishedName: distingushedNameToFind,
                ldapFilter: filter,
                searchScope: SearchScope.Subtree,
                attributeList: attributes.ToArray());

            searchRequest.SizeLimit = 100000;

            try
            {
                var results = ((SearchResponse)connection.SendRequest(searchRequest)).Entries;
                return results;
            }
            catch
            {
                return null;
            }

That's my piece of code, and even when i set searchRequest.SizeLimit = 100000 it will return only 1000 objects because i think it is also set to 1000 on server.

Has anyone have idea how to make some kind of pagination (like take, skip often used in REST) ? I've not founded anything on docs or google...

question from:https://stackoverflow.com/questions/65942509/ldap-searchrequest-pagelimit-pagination

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...