从公元返回的成员的Python win32com.adsi模块的限制数量公元、模块、数量、成员

2023-09-08 13:25:32 作者:旧情复燃

使用下面的code ...

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)

输出始终最大为1500,即使BIG_GROUP包含几千件。我怎样才能在返回BIG_GROUP的所有成员的方式执行此查询?

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?

推荐答案

AD返回n个结果从一个大的属性(如成员),其中N是最大范围检索大小的时候。目录支持一种叫做远程检索,您可以获取每个卖到1500值的分组。 您应该使用对目录中的远程检索控制。我不知道,如果您的LDAP API支持这一点,但该文档应该回答。

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.

下面是更多的信息的方式了一下,从的 MSFT文档

Here is a bit more in the way of info, from the MSFT docs