Meeting cancellation script updated

Articles in the "Meeting cancellation script" series

  1. Cancel future meetings in a mailbox
  2. Meeting cancellation script updated [This article]
  3. Meeting cancellation script updated for large result sets

I have updated the Cancel-MailboxMeetings.ps1 script. These are the changes:

  • Changed the date parameters to align with Microsoft’s Remove-CalendarEvents cmdlet.  StartDate is now QueryStartDate and EndDate is now QueryWindowInDays.  The default time frame is still one year from the query start date, but is now specified as an integer of days instead of a specific date.
  • Added a preview mode via the PreviewOnly switch parameter (also to align with Microsoft).  Using the parameter will list which meetings (by subject and start date, first occurrence start date if a recurring meeting) would be affected.  To provide enough detail, it will indicate if it is a standalone meeting or series and whether the meeting is being canceled (because the mailbox is the organizer) or declined (because the mailbox is an attendee).  If you use the EndOrganizedRecurringMeetings parameter, it will also use wording to show that a meeting series’ end date would be updated instead of canceled.
  • Added detection of modified occurrences that will be lost if a recurring series’ end date is changed.  Because exceptions to a meeting (only modifications, not deletions) are removed when a series’ end date is changed, the script checks for modified occurrences that occurred in the past of the query start date and prompts you to confirm that you want to update that meeting.
  • Added a switch parameter named SuppressLostExceptionPrompt.  Use this if you want to prevent the confirmation prompt about lost modified occurrences and have it change the end date anyway.  This parameter only has an effect if also used with EndOrganizedRecurringMeetings.
  • Although added only while I was testing, but decided to leave in, are some extra details written to the screen if you use the Verbose parameter.

The code in the first post has been updated, as has the downloadable version:

  Cancel-MailboxMeetings.ps1 (12.7 KiB)

8 thoughts on “Meeting cancellation script updated

  1. Hi.

    There’s an error at line 105.
    There’s no $mailbox .

    Changed the line to
    [Microsoft.Exchange.WebServices.Data.ConnectingIdType]::SmtpAddress, $EmailAddress)

    Now impersonation works like a charm.



  2. Thanks for catching that. I must have copied the line from another script where it was using a mailbox object. I will update the download source.

  3. Hello,

    Thanks for sharing this great script,

    But i having a few issues and couldn’t determine cause

    I’m getting error below when running with “-IncludeAttendeeMeetings” parameter. PreviewOnly option is also included.



  4. Hi Scott

    I have troubles with some mailboxes, throwing an exception:


    “You have exceeded the maximum number of objects that can be returned for the find operation. Use paging to reduce the result size and try your request again”

    Any idea to implement paging into your script?


  5. Hi Scott

    You think you could add paging, since I’m getting some exceptions, when large numbers of appointments get returned?

    Exception calling “FindAppointments” with “2” argument(s): “You have exceeded the maximum number of objects that can be returned for the find operation. Use paging to reduce the result size and try your request again.”


  6. I have updated the script to accommodate data sets that are larger than the maximum of 1000 items in a search result.

  7. This is because a single-instance meeting can sometimes have a property incorrectly indicate that it is recurring. I have updated the script to not use this property to identify single-instance versus recurring meetings.

Leave a Reply

Your email address will not be published. Required fields are marked *