【问题标题】:Why PrincipalSearcher gives System.__ComObject for attribut msExchRecipientDisplayType?为什么 PrincipalSearcher 为属性 msExchRecipientDisplayType 提供 System.__ComObject?
【发布时间】:2020-06-10 14:40:20
【问题描述】:

为什么 PrincipalSearcher 给 System.__ComObject 作为属性 msExchRecipientDisplayType ??

我想检索属性 msExchRecipientDisplayTypePrincipalSearcher 提供 System.__ComObject。我也尝试通过 DirectorySearcher 检索它,它给出了正确的值

即''。

0 用户邮箱(共享)
1 MailUniversalDistributionGroup
6 邮件联系
7 用户邮箱(房间)
8 用户邮箱(设备)
1073741824 用户邮箱
1073741833 MailUniversalSecurityGroup

这里提到https://answers.microsoft.com/en-us/msoffice/forum/msoffice_o365admin-mso_exchon-mso_o365b/recipient-type-values/7c2620e5-9870-48ba-b5c2-7772c739c651

但是 DirectorySearcher 只有 1000 个限制??

【问题讨论】:

    标签: c# active-directory directoryservices comobject


    【解决方案1】:

    没有看到您的代码,我不知道您为什么会看到 msExchRecipientDisplayType 属性的 System.__ComObject 值。

    关于 1000 个结果限制:这是来自 Active Directory 的限制,而不仅仅是 DirectorySearcher。要获得更多结果,您需要启用分页,您可以通过设置DirectorySearcherPageSize 属性来实现。只需将其设置为1000,它就会继续为接下来的一千个查询进行新的查询,直到没有更多查询为止。例如,

    var ds = new DirectorySearcher() {
        Filter = "(&(objectClass=user)(objectCategory=person))",
        PropertiesToLoad = { "msExchRecipientDisplayType" },
        PageSize = 1000
    };
    

    【讨论】:

    • 当然我会在几个小时后更新代码。我原则上接收 system.comobject searchr ...但目录搜索器很好。但是目录搜索器有 1000 页的限制。所以不值得。
    • 要获得超过 1000 个,您只需要设置 PageSize,就像我在这个答案中描述的那样。
    • DirectorySearcher 的 PageSize 属性每次都会给出前 1000 个结果。其他结果如何意味着下一个结果??
    • 你能用你正在使用的代码更新你的问题吗?当我设置PageSize = 1000 时,我会从我的域中获得数千个结果,以 1000 页为单位。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多