c# - EWS - 给予预约,获取预约的所有者副本

标签 c# exchangewebservices

在 EWS 中进行预约后,是否可以获得所有者的副本?

例如,如果我以 user1 身份登录,则我拥有 user1user2 创建的约会副本,我有模拟权限,并且想要编辑 user2 的约会副本,如何获取 user2 的副本?

最佳答案

您可以使用 PidLidCleanGlobalObjectId https://msdn.microsoft.com/en-us/library/office/cc839502.aspx将在 session 邀请/更新和约会对象上设置,以在与会者或组织者邮箱中搜索 session ,例如

Appointment newAppointment = new Appointment(service);
newAppointment.Subject = "Test Subject";        
newAppointment.Start = new DateTime(2016, 08, 27, 17, 00, 0);
newAppointment.StartTimeZone = TimeZoneInfo.Local;
newAppointment.EndTimeZone = TimeZoneInfo.Local;
newAppointment.End = newAppointment.Start.AddMinutes(30);
newAppointment.Save();
newAppointment.Body = new MessageBody(Microsoft.Exchange.WebServices.Data.BodyType.Text, "test");
newAppointment.RequiredAttendees.Add("<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2a4b5e5e4f444e4f4f6a4e45474b434404494547" rel="noreferrer noopener nofollow">[email protected]</a>");
newAppointment.Update(ConflictResolutionMode.AlwaysOverwrite ,SendInvitationsOrCancellationsMode.SendOnlyToAll);
ExtendedPropertyDefinition CleanGlobalObjectId = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Meeting, 0x23, MapiPropertyType.Binary);
PropertySet psPropSet = new PropertySet(BasePropertySet.FirstClassProperties);
psPropSet.Add(CleanGlobalObjectId);
newAppointment.Load(psPropSet);
object CalIdVal = null;
newAppointment.TryGetProperty(CleanGlobalObjectId, out CalIdVal);
Folder AtndCalendar = Folder.Bind(service, new FolderId(WellKnownFolderName.Calendar,"<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="96f7e2e2f3f8f2f3f3d6f2f9fbf7fff8b8f5f9fb" rel="noreferrer noopener nofollow">[email protected]</a>"));
SearchFilter sfSearchFilter = new SearchFilter.IsEqualTo(CleanGlobalObjectId, Convert.ToBase64String((Byte[])CalIdVal));
ItemView ivItemView = new ItemView(1);
FindItemsResults<Item> fiResults = AtndCalendar.FindItems(sfSearchFilter, ivItemView);
if (fiResults.Items.Count > 0) {
    //do whatever
}

关于c# - EWS - 给予预约,获取预约的所有者副本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38271407/

相关文章:

c# - 剪贴板在 C# 程序退出时自动清除

c# - 多线程和事件

javascript - 如何使用jquery清除文本框(使用ConfirmButtonExtender)?

c# - ICalRecurrenceId 的值是否会因重复 session 的每个实例而改变

javascript - EWS - JSON 内容中无法识别 token

c# - 如何确定类型是否是 Action/Func 委托(delegate)之一?

c# - 将.net格式字符串转换为java格式字符串

c# - 如何从 EWS 检索公共(public)日历?

exchange-server - Thunderbird EWS 提供商共享文件夹 ID

java - 如何在 Java 中对 Exchange Web 服务连接使用 LDAP 身份验证?