I'm running Exchange Online PowerShell and trying to remove calendar events for a disabled user 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 the Outlook server. I also tried using the user's UPN and email address, and Get-Mailbox produces the same result. How can the object be missing when the user still appears in the directory?
3 Answers
The GUID may be valid in Microsoft Entra ID but not valid as an Exchange mailbox identity. If the license was removed when the account was disabled, the mailbox may have been deleted or become unavailable. Reassigning the appropriate Exchange Online license and waiting for the mailbox to be provisioned again can resolve the lookup failure. After that, retry Remove-CalendarEvents with the mailbox’s UPN or email address.
First, verify that Exchange Online can resolve the identity with Get-Mailbox, then use the mailbox identity returned by that command. A user appearing in Microsoft Entra ID doesn’t necessarily mean an Exchange Online mailbox still exists, so checking the mailbox object is more useful than checking the directory entry.
Get-Mailbox fails with the same error, even though the user is still visible in the directory. That helped point to the mailbox itself rather than the GUID.
PreviewOnly is useful for confirming what Remove-CalendarEvents would change, but it won’t fix an identity-resolution error. The mailbox has to exist in Exchange Online first; a directory object alone isn’t enough for calendar operations.

That was the issue. Removing the license deleted the mailbox. Once I restored the license, Exchange could find it and the command worked.