Back to Admin Workflows

Automate Purview Retention and eDiscovery with PowerShell

Stop running compliance steps by hand in the Purview portal. Generate a PowerShell workflow that handles retention, litigation hold, archives, and eDiscovery.

Microsoft Purview is powerful, but the Compliance portal is not where you want to do anything in bulk. Applying retention policies, enabling archive mailboxes, and creating eDiscovery cases by hand stops scaling almost immediately.

PowerShell — especially the Exchange Online module — is the right tool for this. PSForge gives you the compliance tasks ready to wire into a workflow.

What an enterprise compliance workflow handles

  • Apply retention policies to defined groups of mailboxes
  • Enable archive mailboxes with proper quotas
  • Place departed users on litigation hold
  • Create eDiscovery cases for legal or HR requests
  • Document who has hold and retention applied to them

Why automate this

Compliance work is high-stakes and detail-heavy. Doing it manually is exactly the kind of work that quietly creates legal risk: one mailbox missed, one hold left off, and the organization is exposed.

A documented PSForge workflow is auditable, repeatable, and removes the 'I thought somebody else did that' problem.

Example Purview compliance workflow

  1. Connect to Exchange Online with compliance permissions
  2. Apply the right retention policy to each mailbox group
  3. Enable archive mailboxes for users approaching mailbox limits
  4. Place departing employees on litigation hold with a defined duration
  5. Create eDiscovery cases as legal or HR requests come in
  6. Export a compliance report showing every hold and policy applied

Final thoughts

Purview rewards consistency. Anything you can do once in the portal, you can do better in a workflow.

PSForge gives you that workflow without the PowerShell heavy lifting.

Related guides