The Problem
Classic Exchange Online scenario - trying to remove an orphaned (maybe used to be synced) object.

Getting slapped in the face with error
The Solution
Two words: Graph API.
Step 1: Get the Mail Contact ID
First, we need to identify the exact object we’re dealing with:
| |
This will give the unique identifier for the mail contact.
Step 2: Verify the Object in Graph API
Better safe than sorry- let’s do a double check. Replace <ID> with the ID from Step 1:
| |
Review the output to confirm this is indeed the object you want to remove.
Step 3: Force Delete via Graph API
Exterminate.
| |
More or Less Important Notes
- Graph API deletions are immediate - there’s no confirmation prompt, so triple-check that ID
- Here is how a sample uri looks like:

- URI - not URL (uniform resource identifier)
Summary
Someday we will get Remove-MgContact but today is not the day. We must use a workaround.