编辑其他用户的交换约会

Edit Exchange appointment of other user

我正在编写一项服务,该服务应将 Outlook 约会与另一个系统同步。创建约会后,我需要向正文添加一些信息。该服务在某些技术帐户下 运行,它还作为所有者添加到 Outlook 中的组织者日历中。但是,以下代码没有做任何更改:

var _exchangeService = new ExchangeService(ExchangeVersion.Exchange2010_SP2, TimeZoneInfo.Local)
{
    Url = new Uri(someUrl),
    Credentials = new NetworkCredential(someUser, somePwd, someDomain)
};

Appointment appointment = Appointment.Bind(_exchangeService, someId, new PropertySet(AppointmentSchema.Subject, AppointmentSchema.Start, AppointmentSchema.End));

string oldSubject = appointment.Subject;

appointment.Subject = appointment.Subject + " moved one hour later and to the day after " + appointment.Start.DayOfWeek + "!";
appointment.Start.AddHours(25);
appointment.End.AddHours(25);

  appointment.Update(ConflictResolutionMode.AlwaysOverwrite, SendInvitationsOrCancellationsMode.SendOnlyToAll);

示例代码取自MSDN。当组织者和技术帐户是同一用户时,该代码有效。

你知道哪里出了问题吗?谢谢!

The sample code is taken from MSDN. The code works when Organizer and tech Account is the same user.

这是正确的,因为您只能对进行修改的用户是所有者的约会进行更改(在某些情况下,这将要求您使用 EWS 模拟 https://msdn.microsoft.com/en-us/library/office/dd633680(v=exchg.80).aspx)。对于有多个与会者的会议 object,一旦您在组织者邮箱中进行了更改,就需要将更新发送给与会者,然后他们需要确认这些更新,以便将更新应用于约会的版本在与会者的日历中。

干杯 格伦