问题
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