【发布时间】:2023-04-03 12:11:01
【问题描述】:
我们正在尝试使用作为迁移代码一部分的 EWS 创建事件。有一个众所周知的问题,我们无法设置活动的组织者是原始组织者,这里是场景;
- 正在将用户 A 迁移到用户 B
- 用户 A 在日历中有 30 个事件
- 在这 30 个中,它有 20 个受邀活动,其中 A 是与会者,10 个活动由用户 A 创建(即用户 A 是组织者)
-
当我们迁移它们时,使用以下代码创建所有事件,用户 A 作为组织者。真正的问题是什么
约会约会 = new Appointment(exchangeService);
appointment.MimeContent = new MimeContent("UTF-8", System.IO.File.ReadAllBytes(@"c:\A\test.mime")); //appointment.MimeContent = ; // Set the properties on the appointment object to create the appointment. appointment.Subject = "Tennis lesson with invite 22222"; appointment.Body = "Focus on backhand this week."; appointment.Start = DateTime.Now.AddDays(2); appointment.End = appointment.Start.AddHours(1); appointment.Location = "Tennis club"; appointment.ReminderDueBy = DateTime.Now; Attendee attendee = new Attendee("test@user.com"); appointment.RequiredAttendees.Add(attendee); Mailbox mailbox = new Mailbox(); mailbox.Address = "student@test.com"; // Save the appointment to your calendar. appointment.Save(new FolderId(WellKnownFolderName.Calendar, mailbox), SendInvitationsMode.SendToAllAndSaveCopy); // Verify that the appointment was created by using the appointment's item ID. Item item = Item.Bind(exchangeSevice, appointment.Id, new PropertySet(ItemSchema.Subject));
微软在此处解释了问题;
我不确定这一段到底想说什么;
如果您决定使用 MIME 创建会议,请让 MIME/VCALENDAR 内容使用 METHOD:PUBLISH 而不是 REQUEST。这样做的问题是还有其他需要设置的属性。没有关于需要设置什么或方法是否适用于所有情况的文档或建议。此外,您现在可以让它可靠地工作,但在未来的 Exchange 更新中它可能无法按预期工作。
谁能帮助我如何实现与不同组织者一起创建活动的要求?我有机会这样做吗?
【问题讨论】:
标签: exchange-server exchangewebservices mime