我们的 Exchange 管理员 (Exchange 2010 SP1) 设置了共享资源日历。 没有分配给此资源日历 的邮箱。我希望能够使用 EWS 和 C# 阅读 session 。

片段:

        ExchangeService esvc = new ExchangeService(ExchangeVersion.Exchange2010);
        esvc.Credentials = new WebCredentials(username, password, "ourplace.org");
        esvc.Url = new Uri("https://OWA.OURPLACE.ORG/EWS/Exchange.asmx");

        FolderId shareFolderId = new FolderId(WellKnownFolderName.Calendar, "Shared Calendar Name");
        CalendarFolder.Bind(esvc, shareFolderId);

bind 语句抛出错误:“SMTP 地址没有与之关联的邮箱。”

如何阅读没有关联邮箱的共享资源日历上的项目......或者甚至可能?

谢谢 !!

最佳答案

使用邮件地址绑定(bind)到该日历

首先创建一个FolderId:

FolderId parkplatzCalendarId = new FolderId(WellKnownFolderName.Calendar,"de.calendar.name@company.com");

然后绑定(bind)到这个:
CalendarFolder calendar = CalendarFolder.Bind(_service, parkplatzCalendarId);

现在你可以使用这个日历了!
CalendarView cView = new CalendarView(start, end, int.MaxValue);

cView.PropertySet = new PropertySet(AppointmentSchema.Subject, AppointmentSchema.Start, AppointmentSchema.End, AppointmentSchema.Duration, AppointmentSchema.LastModifiedName, AppointmentSchema.Organizer, AppointmentSchema.Categories);

FindItemsResults<Appointment> appointments = calendar.FindAppointments(cView);

像那样的东西;D

关于c# - 通过 EWS 和 C# 访问没有邮箱的资源日历,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/16154802/

10-09 18:05
查看更多