none
Can't cancel meeting on Exchange Server 2010 (EWS Managed API) RRS feed

  • Question

  • Hi everyone,

    I'm trying to cancel meetings with the code below but can't manage it. The thing is I have enough permission to cancel someone else's meetings on Outlook but can't do it with EWS API. When I try to cancel meetings, I got "User must be an organizer for CancelCalendarItem action." error.

    FolderId calendarId = new FolderId(WellKnownFolderName.Calendar, "xxx@domain.com");
    
    CalendarView cView = new CalendarView(firstDayOfWeek, firstDayOfWeek.AddDays(28));
    cView.PropertySet = new PropertySet(BasePropertySet.FirstClassProperties);
    
    FindItemsResults<Appointment> appointmentResults = service.FindAppointments(calendarId, cView);
    
    appointmentResults.ElementAt(0).CancelMeeting();

    So, can you guys tell me what the problem is?

    Ali COŞKUN

    Tuesday, December 22, 2015 8:52 AM

Answers

  • You can't cancel a meeting that the room is not the organizer of - you have to decline the meeting if you wish to remove it from the calendar.  Hence my previous response.

    That does simplify things, though.  You can skip the step to check to see if the room is the organizer, since it won't be - you can just have your script go through and decline all of the meetings.


    Will Martin ...
    -join ('77696c6c406d617274696e2d66616d696c6965732e6f7267' -split '(?<=\G.{2})' | ? { $_ } | % { [char][int]"0x$_" })



    • Edited by Will Martin, PFE Wednesday, December 23, 2015 1:17 PM
    • Marked as answer by alicoskun Thursday, December 24, 2015 9:34 AM
    Wednesday, December 23, 2015 1:08 PM

All replies

  • It is exactly the error you are seeing:  If you want to clear all meetings on someone's calendar, you can only cancel the ones he is the organizer of.  Your script will need to determine if he's the organizer, then either cancel if he is, or decline if he isn't.

    Will Martin ...
    -join ('77696c6c406d617274696e2d66616d696c6965732e6f7267' -split '(?<=\G.{2})' | ? { $_ } | % { [char][int]"0x$_" })

    Tuesday, December 22, 2015 1:09 PM
  • Thank you for the reply.

    But I want to cancel them all, not the organizer ones. Is there any way to do it?

    The address in the code is a room mailbox by the way. So, it can't be a organizer.


    • Edited by alicoskun Wednesday, December 23, 2015 8:10 AM
    Wednesday, December 23, 2015 7:22 AM
  • You can't cancel a meeting that the room is not the organizer of - you have to decline the meeting if you wish to remove it from the calendar.  Hence my previous response.

    That does simplify things, though.  You can skip the step to check to see if the room is the organizer, since it won't be - you can just have your script go through and decline all of the meetings.


    Will Martin ...
    -join ('77696c6c406d617274696e2d66616d696c6965732e6f7267' -split '(?<=\G.{2})' | ? { $_ } | % { [char][int]"0x$_" })



    • Edited by Will Martin, PFE Wednesday, December 23, 2015 1:17 PM
    • Marked as answer by alicoskun Thursday, December 24, 2015 9:34 AM
    Wednesday, December 23, 2015 1:08 PM
  • Thanks Will, it works as I wanted, when I decline meetings.
    Thursday, December 24, 2015 12:17 PM