Skip to content

Mailbox Message Report 1.0.0

Choose a tag to compare

@Nico77600 Nico77600 released this 07 Oct 12:36
· 19 commits to main since this release

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/exchange gives inPlaceArchiveMailboxId = MBX:<ArchiveGuid>@<tenant ID> (the same GUID as ArchiveGuid of Get-EXOMailbox), and the archive is read like a mailbox: /users/MBX:.../mailFolders/delta, /mailFolders/{id}/messages. Without User.Read.All, a CSV list can give the ArchiveGuid of 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, then contains(): InefficientFilter otherwise); folders left out (-ExcludeFolder); -SkipRecipients for large folders of meeting messages.
  • One mailbox or thousands: -Mailbox (any alias, UPN) or -MailboxFile (text, or CSV with ArchiveGuid); 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) or Both.
  • 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.All reads every column (archive and Recoverable Items too); settings/exchange needs User.Read.All (403 with User.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.