Photo by Suzy Hazelwood on Pexels.com

Issue Description

Recently noticed that Exchange Online module after running connect-exchangeonline, doesn’t show search-mailbox.

As you remember, search-mailbox was a very fast and reliable command to do searches and delete emails in Exchange Online, It was doing these :

  • Search-Mailbox cmdlet enables targeted search and deletion of emails.
  • Facilitates eDiscovery and compliance requirements.
  • Identifies and removes specific or problematic emails.
  • Criteria-based search options include keywords, sender, recipient, and date range.

Cause

Search-Mailbox command was deprecated in 2020 but Microsoft started removing this from exchange powershell now and by end of Apr 2024. It would be gone completely.

fix

Microsoft now recommends to use these two commands, both are slow compared to search-mailbox but this is what it is. I hope new commands would become much faster over the time.

  • New-ComplianceSearchAction.
  • New-ComplianceSearch

Thank you for reading !