简体   繁体   English

编辑其他用户的Exchange约会

[英]Edit Exchange appointment of other user

I'm coding a service which should synchronize Outlook appointments with another system. 我正在编码一项服务,该服务应将Outlook约会与另一个系统同步。 After appointment created I need to add some info to the body. 创建约会后,我需要向正文中添加一些信息。 The service is running under some tech account, it's also added as an owner to the organizer's calendar in Outlook. 该服务在某些技术帐户下运行,并且还作为所有者添加到Outlook中的组织者日历中。 However, the following code doesn't do any changes: 但是,以下代码不做任何更改:

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

The sample code is taken from MSDN. 该示例代码来自MSDN。 The code works when Organizer and tech Account is the same user. 当组织者和技术帐户是同一用户时,该代码才有效。

Do you have any idea of what could be wrong? 您对可能出什么问题有任何想法吗? Thank you! 谢谢!

The sample code is taken from MSDN. 该示例代码来自MSDN。 The code works when Organizer and tech Account is the same user. 当组织者和技术帐户是同一用户时,该代码才有效。

That's correct because you can only make changes to appointments that the user making the modifications is the owner off (in some case this will require that you use EWS Impersonation https://msdn.microsoft.com/en-us/library/office/dd633680(v=exchg.80).aspx ). 这是正确的,因为您只能更改进行修改的用户是所有者的约会(在某些情况下,这将要求您使用EWS Impersonation https://msdn.microsoft.com/zh-cn/library/office/ dd633680(v = exchg.80).aspx )。 For a Meeting object where you have multiple attendees once you make changes in the Organizer mailbox updates then need to be sent out to the attendees who then need to acknowledge those updates for the updates to be applied to the version of the Appointment in the attendee's calendars. 对于拥有多个出席者的会议对象,一旦您在管理器邮箱更新中进行了更改,则需要将其发送给出席者,出席者随后需要确认这些更新,以便将更新应用于出席者日历中的约会版本。

Cheers Glen 干杯格伦

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM