【问题标题】:Exchange EWS: How to get all appointments in a roomExchange EWS:如何在一个房间里获得所有约会
【发布时间】:2014-10-07 14:57:05
【问题描述】:

我正在尝试通过 Exchange EWS 在 Exchange 中获取房间的所有约会。

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
service.UseDefaultCredentials = true;            
service.AutodiscoverUrl("hans.muster@domain.com", RedirectionUrlValidationCallback);

// Return all the room lists in the organization. 
EmailAddressCollection roomLists = service.GetRoomLists();

System.Collections.ObjectModel.Collection<EmailAddress> rooms = service.GetRooms("ZimmerZuerich@domain.com");

EmailAddress roomAdress = rooms[31];

FolderId folderid = new FolderId(WellKnownFolderName.Calendar, new Mailbox(roomAdress.Address));
FindItemsResults<Appointment> aps = service.FindAppointments(folderid, new CalendarView(DateTime.Now, DateTime.Now.AddHours(24)));

如果我运行此代码,我会收到一条错误消息:

{"The specified folder could not be found in the store."}.

事实上,如果我向我展示此类房间邮箱的所有文件夹的集合,其中没有文件夹。

我做错了什么?互联网上的所有示例都适用于 WellKnownFolderName.Calendar。

【问题讨论】:

    标签: resources exchangewebservices


    【解决方案1】:

    该错误通常表明您的凭据可以连接到 Exchange,但您没有尝试访问的日历的权限,因此您需要使用 Add-MailboxPermission 授予对邮箱的访问权限或授予对使用 Add-MailboxFolderPermissions 的日历文件夹

    干杯 格伦

    【讨论】:

    • 但是当我使用相同的凭据在 Outlook 中打开日历时,我可以毫无问题地访问它。我必须以另一种方式访问​​邮箱吗?
    • 您是否尝试过使用 service.credentials 指定凭据?可以用EWSEditor访问房间邮箱ewseditor.codeplex.com
    • 添加日历文件夹的权限解决了这个问题。例如允许用户readonly查看room123上的日历约会:Add-MailboxFolderPermission -Identity room123@test.example.com:\Calendar -AccessRights Reviewer -User readonly@test.example.com
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-03-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-09
    相关资源
    最近更新 更多