This article explains how to create a mailbox contents report using PowerShell and the Microsoft Graph. The list of mailbox items is exported to a workbook.
— Read on practical365.com/mailbox-contents-report/