Remove calendar events from a mailbox using PowerShell

We can use the Remove-CalendarEvents cmdlet from the Exchange Online PowerShell module to cancel future meetings in user or resource mailboxes. Canceling future meetings removes them from attendee and resource calendars. We can use this cmdlet only to remove future meeting events and we cannot remove old calendar events.

Before start, install the Exchange Online PowerShell V2 module and run the below command to connect the Exchange Online Powershell module.

Connect-ExchangeOnline

For example, if you’re going to remove the mailbox, first cancel meetings in the specified mailbox where the mailbox is the meeting organizer. After you cancel the meetings, you can remove the mailbox. The below command cancels all future meetings in the mailbox “[email protected]” that occurs on or after today’s date.

Remove-CalendarEvents -Identity "[email protected]" -CancelOrganizedMeetings

In another case, if a user is taking a temporary leave of absence from the company, we need to remove meetings from the user calendar during his/her absence.  The below command cancels the meetings in Alex Wilber‘s calendar for the specified date range.

Remove-CalendarEvents -Identity "[email protected]" -CancelOrganizedMeetings -QueryStartDate 08-25-2021 -QueryWindowInDays 60

As already said, the command Remove-CalendarEvent is forward-looking and can only cancel future meetings in someone’s calendar. You can refer to the following post to remove old and future events from Microsoft Teams and Outlook calendars.

Remove Calendar Items from Exchange Online using PowerShell »

Advertisement

Leave a Comment