Copilot for Microsoft 365 Tech Accelerator
Feb 28 2024 07:00 AM - Feb 29 2024 11:00 AM (PST)
Microsoft Tech Community

Writing an Exchange Online Mailbox Clean-up Script Using the Microsoft Graph


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.

0 Replies