Repository navigation
Mailbox Message Report 1.0.0
First version: the messages of the primary mailbox and the In-Place Archive of Exchange Online mailboxes — and Recoverable Items — through Microsoft Graph only. No Exchange Online PowerShell, no export. Read only.
Added
- The archive through Microsoft Graph:
GET /beta/users/{id}/settings/exchangegivesinPlaceArchiveMailboxId=MBX:<ArchiveGuid>@<tenant ID>(the same GUID asArchiveGuidofGet-EXOMailbox), and the archive is read like a mailbox:/users/MBX:.../mailFolders/delta,/mailFolders/{id}/messages. WithoutUser.Read.All, a CSV list can give theArchiveGuidof each mailbox. - Recoverable Items (
-IncludeRecoverableItems): Deletions, Purges, Versions, DiscoveryHolds, SubstrateHolds, Calendar Logging, of the primary mailbox and of the archive. - Every message: mailbox, location (Primary / Archive), Recoverable Items, folder path and name, received and sent date and time, subject, from, sender, To, Cc, Bcc, Internet message ID, attachments, importance, read, type, item ID.
- Filters of Exchange: the period (
-Start,-End, received date), the subjects (-Subject, any of them), written the way Exchange accepts them (the date first, thencontains(): InefficientFilter otherwise); folders left out (-ExcludeFolder);-SkipRecipientsfor large folders of meeting messages. - One mailbox or thousands:
-Mailbox(any alias, UPN) or-MailboxFile(text, or CSV withArchiveGuid); a mailbox on-premises, inactive, not found or denied is reported with its reason. - Large mailboxes: 16 requests in flight, 4 at a time per mailbox (a primary mailbox and its archive are two mailboxes); a folder of more than 5,000 items read in slices of its dates, side by side; each page written to disk at once by a compiled writer — the memory does not grow with the messages.
- Reports:
Messages.csv(every message, safe for Excel),Mailboxes.csv,Folders.csv,Summary.json, a self-contained HTML report (messages, folders, mailboxes) with the first 20,000 messages — up to 200,000 with-HtmlMaxMessages(118 MB, open in about 3 s, search and sort under a second);-Layout Global,PerMailbox(one report per mailbox, a summary that links to each) orBoth. - Console with steps, progress and time left; WPF window (
-Gui, Fluent theme) to type the search, follow it and preview the first messages; daily log; exit codes 0 / 1 / 2. - 30 Pester tests on a simulated Exchange Online tenant; a measurement tool; a user guide and a developer guide in Markdown and self-contained HTML.
Validated on a lab tenant
- Primary mailboxes and archives read through their
MBX:IDs; Recoverable Items; mailboxes without archive, on-premises and not found; periods and subjects; one report per mailbox. - Permissions measured with temporary applications:
Mail.ReadBasic.Allreads every column (archive and Recoverable Items too);settings/exchangeneedsUser.Read.All(403 withUser.ReadBasic.All). - 5,204 messages of one mailbox and its archive in 15 s; a folder of 39,419 meeting messages read in 8 slices, every message once: 43 s without the recipients, 7 min 27 s with them (Exchange reads the recipients of each message: 28.5 s per 1,000 instead of 0.4 s).
Requirements
PowerShell 7.4+ on Windows 10 / 11 or Windows Server 2016 to 2025, Exchange Online, an application registered in Microsoft Entra with Mail.ReadBasic.All and User.Read.All (application permissions, admin consent) and a certificate. Not the auxiliary archives of an auto-expanding archive; settings/exchange is a beta endpoint of Graph.
Unblock the files after downloading: Get-ChildItem "C:\Chemin\Du\Dossier" -Recurse -File -Force | Unblock-File.
Guides: docs\MailboxMessageReport-UserGuide.html and docs\MailboxMessageReport-Guide.html in the zip.