I'm running Exchange Online PowerShell and trying to remove the calendars for disabled users with Remove-CalendarEvents. I copied the user's GUID from Microsoft 365/Azure, but Exchange returns an error saying the object couldn't be found on an Outlook server. I get the same result when using the user's UPN or email address, and Get-Mailbox also can't locate it. What could cause this if the user still appears in the directory?
3 Answers
The GUID may still exist in Azure while the Exchange mailbox has already been removed. In this case, the license had been removed when the account was disabled, which deleted the mailbox. Reassigning an appropriate Exchange Online license recreated the mailbox, after which Remove-CalendarEvents worked. Check the user’s Exchange licensing and mailbox status before running the cleanup command.
Try the command with -PreviewOnly first. It won’t make changes, but it can confirm whether Exchange recognizes the mailbox and show what the command would process. If PreviewOnly fails with the same object-not-found message, the issue is mailbox availability rather than the calendar-removal parameters.
First verify that Exchange Online can actually resolve the object with Get-Mailbox -Identity . Being present in Azure or Microsoft 365 doesn’t necessarily mean the user still has an Exchange mailbox. Also make sure you’re using the mailbox identity that Remove-CalendarEvents expects, rather than a directory-only object ID.

PreviewOnly produced the same error, so it looks like Exchange couldn’t resolve the object at all.