Aug 08 2022 05:51 AM
This article describes how to write a PowerShell script to search user mailboxes for items matching search criteria. The items can then be reported or deleted using Microsoft Graph APIs. The script isn't a replacement for the Search-Mailbox cmdlet, but it does a reasonable job and is faster than compliance search purge actions. Above all, it's a learning exercise to discover the possibilities that exist with the combination of PowerShell, Graph APIs, and mailboxes.