I built a PowerShell system that enforces a granular email-retention policy against Exchange Online using the Exchange API tools — bringing advanced mail-management capabilities in-house without paying for the premium Microsoft 365 license tier that normally gates them.
Retention Locked Behind a Premium License
Granular email retention in Microsoft 365 normally lives behind a premium license tier — the advanced mail-governance features we needed were gated by cost, not capability. The challenge was to enforce the same granular policy ourselves, script-driven against Exchange Online.
What I Delivered

Granular retention policy
Enforced a fine-grained email-retention policy across Exchange Online mailboxes.

PowerShell + Exchange API
Built it in PowerShell against the Exchange API tools for full, scriptable control.

No premium license
Delivered the advanced mail management without buying the premium M365 tier.

Automated enforcement
Ran the policy automatically, so retention stays enforced without hand-holding.
Skills & Tools
The stack behind this build — tap any to see related work.
The Impact
Granular, automated email retention enforced across Exchange Online — the advanced mail governance a premium Microsoft 365 license would sell, delivered in-house by script at no added licensing cost.
Script Around the Paywall
Some ‘enterprise features’ are just capabilities behind a bigger invoice. A PowerShell policy against the Exchange API delivered the same granular retention on our own terms — governance kept, license upsell declined.
Image credits: “Programming code” by Martin Vorel (CC BY-SA 4.0) · “Padlock with chain” by Lacz02 (CC BY-SA 4.0)


