Creating an Exchange Server Calendar Assignment as Another Non-Impersonated User (EWS)

I am creating a simple meeting scheduling application and I want to realize the opportunity for me to create appointments for my users.

I was able to create, update and delete my calendar on the Exchange Server, and I was able to create appointments by adding my colleagues as RequiredAttendees, for example:

//service variable is being created using my credidentals Appointment meeting = new Appointment(service); meeting.Subject = "Some subject "; meeting.Body = "Some body."; meeting.Start = DateTime.Now; meeting.End = meeting.Start.AddHours(4); meeting.Location = "Some Location"; meeting.RequiredAttendees.Add(" myCollegue@mail.com "); meeting.ReminderMinutesBeforeStart = 60; meeting.Save(new FolderId(WellKnownFolderName.Calendar, " myCollegue@mail.com "), SendInvitationsMode.SendToAllAndSaveCopy); 

But he just sets it up on the right face. The next thing I tried to use impersonation, but I can’t access the hosting server to establish myself as a host, and others - to share the calendar with me (because of permissions, etc.), so I also had to clear it. He also appointed me as his publisher on his calendar. Is there something I can't see or can't find on MSDN sites?

EDIT: I can create an appointment on my calendar in outlok.

+5
source share
1 answer

If someone is facing the same problems as me, follow these steps here:

  • Make sure that the person for whom you are creating a meeting sets you up (on the exchange server or in outlok as "Editing the author" with all permissions.

  • After that, you can create meetings for him (check this by going to your outlok and creating some test meetings).

This code works for me:

 Folder inboxFolder = Folder.Bind(service, new FolderId(WellKnownFolderName.Calendar, " your.colleague@company.com ")); Appointment appointmentOther = new Appointment(service); appointmentOther.Subject = "Test 2"; appointmentOther.Body = "Body text"; appointmentOther.Start = DateTime.Now; appointmentOther.End = DateTime.Today.AddHours(16); appointmentOther.Location = "My Office"; appointmentOther.IsReminderSet = true; appointmentOther.ReminderMinutesBeforeStart = 30; appointmentOther.Save(inboxFolder.Id,SendInvitationsMode.SendToNone); 

Good luck :)

+5
source

All Articles