Python win32com.adsi module limits number of returned members from AD
Question: Using the following code...

    
    
    import win32com.adsi
    
    DNC=win32com.adsi.ADsGetObject('LDAP://rootDSE').Get('DefaultNamingContext')
    path = 'LDAP://cn=BIG_GROUP,ou=Groups,'+DNC
    groupobj = win32com.adsi.ADsGetObject(path)
    users = groupobj.member
    print len(users)
    

The output is always a maximum 1500, even if BIG_GROUP contains several
thousand members. How can I execute this query in a way that returns all
members of BIG_GROUP?


Answer: AD returns N results at a time from a large attribute (like member), where N
is the max range retrieval size. The directory supports something called
ranged retrieval where you can fetch groupings of up to 1500 values per fetch.  
You should use the ranged retrieval control against the directory. I don't
know if your LDAP API supports this but the docs should answer.

Here is a bit more in the way of info, from the [MSFT
docs](http://msdn.microsoft.com/en-
us/library/windows/desktop/aa367017%28v=vs.85%29.aspx)

