In Microsoft 365, exporting only the In-Place Archive mailbox to PST isn't straightforward.
While the normal Content Search in Microsoft Purview includes both the primary and archive mailboxes, there's no direct option to select the archive mailbox alone.

To solve this, I wrote a PowerShell script that helps you create a targeted Compliance Search for all folders inside the archive mailbox allowing you to export only archive data later via the Purview portal .

What the Script Does

This PowerShell script:

Prerequisites

To run this script successfully, make sure:

In Exchange Online

You have the Exchange Administrator role.
This role provides the required access to connect to Exchange Online PowerShell and retrieve mailbox folder statistics.

In Microsoft Purview

You must have permissions to:

(These are typically included in the eDiscovery Manager or Compliance Administrator roles.)

PowerShell Modules Required

Make sure these modules are installed and updated:

  
    Install-Module ExchangeOnlineManagement -Force
Import-Module ExchangeOnlineManagement
  

You'll also need the Security & Compliance PowerShell module for connecting to Purview:

  
    Connect-IPPSSession
  

Execution Workflow

  1. Download the Script

  1. Launch PowerShell and Run the Script

  1. Connect to Exchange Online PowerShell

  1. Retrieve Mailbox Folder Details

  1. Create a Compliance Search

  1. Connect to Microsoft Purview (Compliance Center)

  1. Start the Compliance Search

  1. Export and Download PST from Purview

Benefits of Using This Automation

🏁 Conclusion

Exporting data from In-Place Archive mailboxes in Microsoft 365 has always been a tedious and partially manual process.
This PowerShell automation provides a reliable and repeatable way to:

With the right permissions and setup, this script can significantly simplify archive mailbox export tasks for Exchange Online administrators.