Exchange Web服务仅返回ContactGroup的16个成员

时间:2018-08-16 15:38:23

标签: exchange-server exchangewebservices members

我正在尝试遍历公用文件夹并导出所有联系人。该代码通常可以正常工作,但是ContactGroups(通讯组列表)存在问题。

我使用C#和称为Microsoft.Exchange.WebServices 2.2的NuGet包作为EWS的包装。该服务器是Microsoft Exchange Server 2013内部部署。

至少有一个我在Outlook中看到它包含150个以上的成员,但是当我尝试通过EWS检索它们时,它仅显示16个。我看不到任何选择页面大小或类似内容的选项。那个。

尝试了几种方法:

private void ProcessContactGroup( ContactGroup contactGroup)
{
    contactGroup.Load(new PropertySet(
            ContactGroupSchema.Members,
            ContactGroupSchema.DisplayName
        ));


    int count = contactGroup.Members.Count; // this is 16, should be 150
}

private void ProcessContactGroup( ContactGroup contactGroup)
{
    contactGroup.Load();

    int count = contactGroup.Members.Count; // this is 16, should be 150
}

private void ProcessContactGroup(ExchangeService service, ContactGroup contactGroup)
{
    contactGroup.Load();

    service.LoadPropertiesForItems(new[] { contactGroup }, PropertySet.FirstClassProperties);

    var result = service.ExpandGroup(contactGroup.Id);

    int count = result.Members.Count; // Still 16
}

我在做什么错?不胜感激。

0 个答案:

没有答案