0
votes

I'm working on synchronisation of appointments , tasks from our application to Exchange and back .

The EWS is showing appointments on resources ( required attendees , optional attendees ) calendar only when SendInvitationsMode enum passed as either SendInvitationsMode.SendToAllAndSaveCopy or SendInvitationsMode.SendOnlyToAll .

If we set SendInvitationsMode enum to SendInvitationsMode. SendToNone then it's saving appointment only on Organizer calendar.

Sample code

        Appointment meeting1 = new Appointment(service);

        ImpersonatedUserId impersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "organizer email");
        service.ImpersonatedUserId = impersonatedUserId;
        meeting1.Subject = "Checking responses";
        meeting1.Body = "The purpose of this meeting is to check status.";
        meeting1.Start = new DateTime(2017, 4,14, 12, 0, 0);
        meeting1.End = meeting1.Start.AddHours(2);
        meeting1.Location = "Conf Room";

        Attendee attendee = new Attendee();
        attendee.Address = "attendee email address";
        attendee.Name = "name";
        meeting1.RequiredAttendees.Add(attendee);
        meeting1.Save(SendInvitationsMode.SendToNone);

Is there a way to insert appointments where all attendees can see in their respective calendars with out email notifications ? It doesn't make sense to send notification for past appointments .

1

1 Answers

0
votes

Your using a Client API so the API call your using only has access to the Organiser's Mailbox. If you want to do things on the Attendee Mailboxes (an you need to also understand that attendees can be internal or external so you have a general logic fail here) you need to change your security context eg from impersonating the Organiser to impersonate the particular attendee and then accept the meeting for that attendee and every attendee you want to update.

Your other logic fail is you need to take into account whether the attendee has accepted or declined the Meeting response in the first place. Attendees maintain their own Exchange Store item for each meeting and its up to the client to maintain the status/updates not the server. The only exception to this would be a Room mailbox where auto Accept is enabled but even then there is Mailbox assistant that manages the processing of invitations/update/cancellations.