c# – 在没有模拟的其他用户(EWS)上创建Exchange服务器日历上的约会
作者:互联网
我正在为约会安排创建简单的应用程序,我想实现为我的用户创建约会的能力.
我设法在Exchange Server上创建,更新和删除我的日历,我有点设法创建约会,将我的同事添加为RequiredAttendees,如下所示:
//service variable is being created using my credidentals
Appointment meeting = new Appointment(service);
meeting.Subject = "Some subject ";
meeting.Body = "Some body.";
meeting.Start = DateTime.Now;
meeting.End = meeting.Start.AddHours(4);
meeting.Location = "Some Location";
meeting.RequiredAttendees.Add("myCollegue@mail.com");
meeting.ReminderMinutesBeforeStart = 60;
meeting.Save(new FolderId(WellKnownFolderName.Calendar,
"myCollegue@mail.com"),
SendInvitationsMode.SendToAllAndSaveCopy);
但这只是让他成为必要的与会者.接下来的事情是我尝试使用模拟,但我无法访问托管服务器将自己设置为主人和其他人必须与我共享日历(由于权限和东西)所以我不得不刮掉它.此外,他让我成为他日历上的出版作家.
是否有我遗漏的东西,或者似乎无法在MSDN网站上找到?
编辑:我能够在他的日历中创建约会.
解决方法:
如果有人遇到我在此处遇到的相同问题,请按以下步骤操作:
>确保您正在为其创建约会的人员(在交换服务器上或在outlok中为“编辑作者”设置所有权限).
>之后,您可以为他创建约会(通过转到您的outlok并创建一些测试约会来验证这一点).
这段代码适合我:
Folder inboxFolder = Folder.Bind(service, new FolderId(WellKnownFolderName.Calendar, "your.colleague@company.com"));
Appointment appointmentOther = new Appointment(service);
appointmentOther.Subject = "Test 2";
appointmentOther.Body = "Body text";
appointmentOther.Start = DateTime.Now;
appointmentOther.End = DateTime.Today.AddHours(16);
appointmentOther.Location = "My Office";
appointmentOther.IsReminderSet = true;
appointmentOther.ReminderMinutesBeforeStart = 30;
appointmentOther.Save(inboxFolder.Id,SendInvitationsMode.SendToNone);
祝好运 :)
标签:c,exchangewebservices,exchange-server,ews-managed-api 来源: https://codeday.me/bug/20190519/1134911.html