Exchange 2013 API -获取房间属性

本文关键字:房间 属性 获取 2013 API Exchange | 更新日期: 2023-09-27 18:16:49

我正在尝试使用EWS API从Exchange获取房间详细信息。

下面是获取房间列表的示例。

因此,根据代码,我试图获得房间的详细信息,如位置,城市,州等,但与代码示例的代码块,我只得到Id, MailboxType, Name & RoutingType

我试过的代码片段:

// Initialize service object here
EmailAddressCollection myRoomLists = service.GetRoomLists();
foreach (EmailAddress address in myRoomLists)
{
     EmailAddress myRoomList = address.Address;
     Console.WriteLine("Email Address: {0}", address.Address);
}

真的很感激,如果有人能帮助我在获得房间属性(位置,城市,国家等)与Exchange API在c# ?

Exchange 2013 API -获取房间属性

RoomList操作将只返回列表中房间邮箱的emailaddress。为了获得更多的信息,你需要使用类似于ResolveName的操作并返回ContactInformation,例如

        EmailAddressCollection myRoomLists = service.GetRoomLists();
        foreach (EmailAddress address in myRoomLists)
        {
            EmailAddress myRoomList = address.Address;
            PropertySet AllProps = new PropertySet(BasePropertySet.FirstClassProperties);
            NameResolutionCollection ncCol = service.ResolveName(address.Address, ResolveNameSearchLocation.DirectoryOnly, true, AllProps);
            foreach (NameResolution nr in ncCol)
            {
                Console.WriteLine(nr.Contact.DisplayName);
                Console.WriteLine(nr.Contact.Notes);
            }
        }

房间容量不是EWS公开的属性,因此您需要使用变通方法来获取它https://social.technet.microsoft.com/Forums/office/en-US/9eef45a5-dd1d-4912-9beb-bded7b40cb9e/ews-managed-api-using-c?forum=exchangesvrdevelopment

干杯格伦