Delete all calendar events from an ex-employee's mailbox in Office 365
If the ex-employee's mailbox has been converted to a shared mailbox, you can still use the Remove-CalendarEvents cmdlet in Exchange Online PowerShell to delete future calendar events ā as long as the shared mailbox is mail-enabled (i.e., it can still send mail, which is required to send cancellation notices).
ā
PowerShell Command for Shared Mailbox
PowerShell
Remove-CalendarEvents -Identity "sharedmailbox@yourdomain.com" -CancelOrganizedMeetings -QueryWindowInDays 365
Show more lines
Parameters:
-
-Identity: The email address of the shared mailbox.
-
-CancelOrganizedMeetings: Ensures only meetings organized by this mailbox are canceled.
-
-QueryWindowInDays: Specifies how far into the future to cancel meetings (e.g., 365 days).
You can also specify a start date:
PowerShell
Remove-CalendarEvents -Identity "sharedmailbox@yourdomain.com" -CancelOrganizedMeetings -QueryStartDate "2025-11-01" -QueryWindowInDays 365
Show more lines
This will cancel meetings from Nov 1, 2025 onward for 365 days. [learn.microsoft.com]