通过 EWS 和 C# 访问没有邮箱的资源日历

2024-03-14

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

Snippet:

        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);

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

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

谢谢 !!


使用电子邮件地址绑定到该日历

首先创建一个FolderId:

FolderId parkplatzCalendarId = new FolderId(WellKnownFolderName.Calendar,"[email protected] /cdn-cgi/l/email-protection");

然后绑定到这个:

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

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

通过 EWS 和 C# 访问没有邮箱的资源日历 的相关文章

随机推荐