Table of Contents
Use Remove-CalendarEvents to Cancel Teams or Regular Meetings Owned By a Specific User
The question arose about how an administrator can cancel Teams meetings scheduled by a user who is currently unavailable. Because cancelling meetings on behalf of a user is not a day-to-day administrative operation, no option is available for this purpose in the Teams admin center or the Microsoft 365 admin center. However, the Remove-CalendarEvents cmdlet in the Exchange Online management module will do the job (the cmdlet is also available for Exchange 2019).
Normally, administrators don’t interfere with meeting arrangements. Those who create meetings (the organizers) take care of scheduling and maintaining meeting settings, whether they own the calendar or are a calendar delegate. Reasons why an administrator might intervene include:
- The organizer is unavailable for a sustained period and the need exists to rearrange the meeting.
- The organizer has left the company.
- The organizer is due to leave the company and part of the offboarding process involves cancellation of all their future meetings.
Mailbox Access Required
In all cases, Remove-CalendarEvents can only work if access is still available to the user’s mailbox. Exchange Online must be able to connect to the mailbox to access the organizer’s calendar to remove events. For this reason, if you plan to cancel a user’s meetings when they leave the company, the correct procedure is:
- Sign in as with an account holding the Exchange administrator or global administrator role.
- Revoke access to their account.
- Run Remove-CalendarEvents to cancel all future meetings in the user’s mailbox where they are the meeting organizer and the meeting has one or more attendees (including resources like meeting rooms). Cancellations cover both normal meetings and online meetings (using Teams or another online provider). Events without attendees (appointments) are left untouched. The mailbox sends meeting cancelations to meeting participants.
- Proceed with the remainder of the account removal process. If holds exist on the mailbox, it becomes inactive. However, you can’t cancel meetings from an inactive mailbox. If you forget to cancel meetings, restore the inactive mailbox, cancel the meetings, and then delete the mailbox again.
The Remove-CalendarEvents cmdlet can cancel meetings up to 1825 days (five years) in the future, which should be more than sufficient in most cases. You can perform a test run beforehand to see what meetings it will remove by including the PreviewOnly parameter. For example, this command previews what will happen if the cmdlet removes meetings from the current date up to 365 days in the future:
Remove-CalendarEvents –Identity firstname.lastname@example.org -CancelOrganizedMeetings -QueryStartDate (Get-Date) -QueryWindowInDays 365 -PreviewOnly Confirm Are you sure you want to perform this action? The meeting(s) will be canceled and removed from the calendar. This action cannot be undone. [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y The meeting with subject "Glastonbury Meeting" and start date "09/06/2023" has been queued for cancellation. The meeting with subject "Project X" and start date "09/06/2023" has been queued for cancellation. The meeting with subject "Project Mercury" and start date "17/06/2023" has been queued for cancellation. The meeting with subject "Project Botha" and start date "21/06/2023" has been queued for cancellation. The meeting with subject "Project Botha" and start date "28/06/2023" has been queued for cancellation.
When ready to proceed, remove the PreviewOnly parameter and run the command again. Exchange Online connects to the mailbox, finds the relevant meetings, and cancels them. Cancellation occurs immediately. Meeting participants receive a cancellation notice as normal (Figure 1).
Graph Delete Event API
If you need a programmatic method to remove calendar events, the Graph includes a Delete Event API. An app with the Calendars.ReadWrite application permission can connect to a mailbox, find relevant events in the calendar, and delete them.
Reduced Price for Office 365 for IT Pros
We’re on course to publish the 2024 edition of the Office 365 for IT Pros eBook on July 1. Because the 2023 book is no longer receiving updates, we have reduced its price to $35. People who buy the 2023 book will be able to upgrade to the 2024 edition at a low cost. We think this is a good deal!