Why PrincipalSearcher gives System.__ComObject for attribut msExchRecipientDisplayType?

99封情书 提交于 2020-06-17 15:56:19

问题


Why PrincipalSearcher gives System.__ComObject for attribut msExchRecipientDisplayType ??

I want to retrieve attribute msExchRecipientDisplayType and PrincipalSearcher gives System.__ComObject. Also I tried to retrieve it by DirectorySearcher and it gives correct value

i.e. ''.

0 UserMailbox (shared)
1 MailUniversalDistributionGroup
6 MailContact
7 UserMailbox (room)
8 UserMailbox (equipment)
1073741824 UserMailbox
1073741833 MailUniversalSecurityGroup

as mentioned here https://answers.microsoft.com/en-us/msoffice/forum/msoffice_o365admin-mso_exchon-mso_o365b/recipient-type-values/7c2620e5-9870-48ba-b5c2-7772c739c651

But DirectorySearcher has only 1000 limit ??


回答1:


Without seeing your code, I don't know why you're seeing a System.__ComObject value for the msExchRecipientDisplayType attribute.

About the 1000 result limit: this is a limit from Active Directory, not just DirectorySearcher. To get more results, you need to enable paging, which you can do by setting the PageSize property of the DirectorySearcher. Just set it to 1000 and it will keep making new queries for the next thousand until there are no more. For example,

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


来源:https://stackoverflow.com/questions/62306314/why-principalsearcher-gives-system-comobject-for-attribut-msexchrecipientdispl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!