We are trying to create event using EWS which is a part of the migration code. There is a well know issue where we cant set the organizer of event which is the orginal one, here is scenario;
- User A is being migrated to User B
- User A has 30 events in Calendar
- Out of those 30, it has 20 invited events where A is attendee and 10 events which is created by user A (i.e. user A is organizer)
When we migrate them over, using below code all the events are created with User A as organizer. Which is the real issue
Appointment appointment = new Appointment(exchangeSevice);
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("[email protected]"); appointment.RequiredAttendees.Add(attendee); Mailbox mailbox = new Mailbox(); mailbox.Address = "[email protected]"; // 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));
Issue is explained here by Microsoft;
I am not sure what exactly this paragraph is trying to say;
If you decide to create the meeting using MIME, have the MIME/VCALENDAR content use METHOD:PUBLISH instead of REQUEST. The problem with this is that there are other properties which need to be set. There is no documentation or recommendations on what all would need to be set or if methodology might work in all cases. Further, you might get it to work reliably for now, however it may not work as expected in future updates to Exchange.
Can anyone help on how do I achieve my requirement of create event with different organizer? Is there any chance I can do so?