How to Delete a User from 365

# 1 - Get mailbox details
Get-Mailbox -SoftDeletedMailbox -Identity "james" | Select Name, ExternalDirectoryObjectId, PrimarySmtpAddress

# 2 - Remove from Entra ID recycle bin
Remove-MgDirectoryDeletedItem -DirectoryObjectId "xxxxxxxxxxxxxxxxxxxxxx"

# 3 - Exclude from all holds
Set-Mailbox -Identity "xxxxxxxxxxxxxxxxxxxxxx" -ExcludeFromAllHolds

# 4 - Wait for hold removal to propagate
Start-Sleep -Seconds 60

# 5 - Permanently delete
Remove-Mailbox -Identity "xxxxxxxxxxxxxxxxxxxxxx" -PermanentlyDelete:$true -Confirm:$false
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...