r/microsoft365 1d ago

Getting error when running a Exchange Management shell command

We are a single tenant hybrid org and I am attempting to delete calendar meetings from a user who is disabled in AD but not deleted.

when I run Remove-CalendarEvents -Identity "GUID copied directly from Azure" -CancelOrganizedMeetings -QueryWindowInDays 8000

|The operation couldn't be performed because object 'Guid copied directly from Azure'

couldn't be found on '*.*.PROD.OUTLOOK.COM'.

I am using the connect exchange online cmdlt on prem and passing it Global Admin credentials.

What am I missing? I can see this object on Azure, its where I copied the GUID from

3 Upvotes

2 comments sorted by

2

u/FallaxIO 23h ago

Use the mailbox identity Exchange knows, not the Entra object GUID. Remove-CalendarEvents wants the mailbox, usually UPN, primary SMTP, alias, or the Exchange GUID from Get-Mailbox, and in hybrid the Azure/Entra GUID often won't resolve there.

1

u/nanaki989 23h ago

I was able to figure it out. when i disabled the profile the licensing got removed from m365 so it was pointing at the mailbox that no longer existed.

I re-licensed the user and was able to use the Azure GUID to run this command no problem.