问题描述
当我使用Service帐户添加新约会时,组织者始终是Credentials to Exchange服务的用户,我想将组织者设置为其他用户,但是Organizer属性为只读,我该如何实现?
When I use Service account to add a new appointment, the organizer always the user of Credentials to Exchange service, I want to set the organizer to another user, but the organizer property is readonly, how can I achieve that?
var appointment = new Appointment(_service.ExchangeService);
if (exchangeAppointment.Participants.Any() && exchangeAppointment.Participants != null)
{
foreach (var participant in exchangeAppointment.Participants)
{
appointment.RequiredAttendees.Add(participant);
}
}
appointment.Resources.Add(exchangeAppointment.RoomAdIdentityEmail);
appointment.Location = string.Join(",", appointment.Resources);
appointment.Subject = exchangeAppointment.Subject;
appointment.Body = exchangeAppointment.Body;
appointment.Start = exchangeAppointment.StartTime;
appointment.End = exchangeAppointment.EndTime;
appointment.Save(SendInvitationsMode.SendToAllAndSaveCopy);
推荐答案
将根据您保存约会的日历来设置管理器,当您使用服务帐户创建组织者的约会代理时,您需要将保存位置"设置为所需的管理器的日历,例如
The Organizer is going to be set based on the Calendar your saving the Appointment to, when you using a Service Account your creating the Appointment OnBehalf of the Organizer so you would need set the Save location to the calendar of the Organizer you want eg
Save(new FolderId(WellKnownFolderName.Calendar, "[email protected]"), SendInvitationsMode.SendToAllAndSaveCopy);
另一种选择是使用EWS模拟,然后模拟组织者 http://msdn.microsoft.com/en-us/library/office/dd633680%28v=exchg.80%29.aspx
The other option is to use EWS Impersonation and then Impersonate the Organizer http://msdn.microsoft.com/en-us/library/office/dd633680%28v=exchg.80%29.aspx
欢呼格伦
这篇关于约会的Exchange Web服务集的组织者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!