gpt4 book ai didi

resources - 交换EWS : How to get all appointments in a room

转载 作者:行者123 更新时间:2023-12-02 23:09:33 25 4
gpt4 key购买 nike

我正在尝试通过 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。

最佳答案

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

干杯格伦

关于resources - 交换EWS : How to get all appointments in a room,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26238991/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com