Step-by-step Exchange Online PowerShell scripts to export Microsoft 365 mailboxes to PST. Current cmdlets for EXO V3 and official Microsoft Purview Content Search procedures.
On This Page (8 sections) ▾
- 1. Prerequisites & Required Admin Roles
- 2. Method 1: Official Supported Workflow via Microsoft Purview Portal (Cases → Searches → Query → Export)
- 3. Method 2: PowerShell Script Automation for Content Search Creation
- 4. Technical Note: Status of Legacy ClickOnce eDiscovery Export Tool
- 5. Method 3: Standalone Direct Mailbox Export via Prism Office 365 Backup Tool
- 6. Technical Comparison: Microsoft Purview vs Prism Migration Engine
- 7. Frequently Asked Questions (FAQs)
- 8. Summary
Running New-MailboxExportRequest in Exchange Online PowerShell results in an immediate error:
The term 'New-MailboxExportRequest' is not recognized as the name of a cmdlet, function, script file, or operable program.This error occurs because Microsoft designed New-MailboxExportRequest strictly for on-premises Exchange Server environments, where the Mailbox Replication Service (MRS) exports data directly to local network SMB/UNC shares (\\Server\Share\file.pst). Exchange Online does not expose direct SMB file paths or local MAPI spooler endpoints.
In modern Microsoft 365, administrators exporting mailbox data to PST must use the official Microsoft Purview Content Search & Export workflow. While you can automate search creation using the ExchangeOnlineManagement v3 PowerShell module, Microsoft requires retrieving the finalized .pst package through the Microsoft Purview portal web interface.
Below are the complete prerequisites, the current official Microsoft Purview portal procedure, the automation PowerShell script, and standalone backup alternatives.
Prerequisites & Required Admin Roles
Before connecting to Security & Compliance PowerShell or the Purview portal, your administrative account must be assigned specific compliance roles:
- Purview Roles: The account must have eDiscovery Manager or eDiscovery Administrator permissions assigned in the Microsoft Purview portal (
https://purview.microsoft.com). - PowerShell Module: The
ExchangeOnlineManagementv3 module (EXO V3) installed on your administrative workstation. - Environment: Windows PowerShell 5.1 or PowerShell 7.x.
Role Propagation Delay in Microsoft Purview:
According to Microsoft documentation, role assignments in Microsoft Purview (such as eDiscovery Manager or Compliance Administrator) can take up to 60 to 90 minutes to propagate across all cloud directory endpoints. If cmdlets return permission denied errors immediately after assignment, allow adequate time for directory replication.
Method 1: Official Supported Workflow via Microsoft Purview Portal (Cases → Searches → Query → Export)
The primary, Microsoft-supported procedure to search and export mailbox data to a .pst file is performed through the Microsoft Purview portal (https://purview.microsoft.com) using the eDiscovery Cases workflow:
Step 1: Sign in to Microsoft Purview & Open eDiscovery Cases
- Sign in to the Microsoft Purview portal using an administrative account assigned the eDiscovery Manager or Compliance Administrator role.
- In the left navigation menu, expand eDiscovery and select Cases (or navigate to Solutions > eDiscovery > Standard cases).
- Select an existing case from the list, or click Create a case to establish a new administrative container for your export task.
Step 2: Create a Search within the Case
- Inside your selected case, navigate to the Searches tab on the top menu bar.
- Click New search to launch the search configuration wizard.
- On the Name and description page, enter a clear identifier (e.g.,
M365_Export_UserMailbox) and click Next.
Step 3: Configure Target Mailbox Locations & Search Query
- On the Locations page, toggle Exchange mailboxes to On.
- Click Choose users, groups, or teams (or Specific locations), search for the target user or shared mailbox email address, and select it.
- On the Define search conditions (Query) page:
- To export the entire mailbox without filtering, leave the keyword query box empty and do not add conditions.
- To export targeted items, construct a query using Keyword Query Language (KQL) or add specific conditions (such as date range
received:2025-01-01..2026-10-01or specific sender/subject criteria).
- Review your settings and click Submit. Wait for the search status on the Searches tab to report Completed.
Step 4: Trigger the Export Action & Configure Package Settings
- On the Searches tab, select your completed search query.
- Select Export from the action toolbar to launch the export flyout pane.
- Under Output options, choose your export format:
- Create PSTs for messages: Exports Exchange mailbox messages into standard
.pstdata files. - Create .msg files for messages: Exports individual email messages as standalone
.msgfiles.
- Configure data grouping:
- Enable Organize data from different locations into separate folders or PSTs if you want per-mailbox segregation (creating distinct PST files or directories for each user or shared mailbox). Leave unchecked to combine mailbox data into unified output files.
- Select whether to include unindexed items and whether to enable deduplication for Exchange content.
- Under Package size settings, configure format-specific package limits:
- PST Package Size: Options include 1 GB, 2 GB, 5 GB (Default), or 10 GB. Microsoft Purview splits mailbox data into consecutive numbered PST files when items reach the selected size limit.
- ZIP Container Size: Options include 2 GB, 10 GB (Default), 20 GB, or 40 GB.
- Container Sizing Rule: The selected ZIP package size must be equal to or greater than the selected PST package size (e.g., if selecting a 10 GB PST package size, the ZIP container size must be set to 10 GB, 20 GB, or 40 GB).
- Select Export to start cloud package generation.
Step 5: Monitor and Download via Process Manager
- Navigate to Process manager in the left or case navigation menu.
- Under the Export process list, select your active or completed export job.
- On the flyout pane, open the Overview tab.
- Under Export packages, locate the generated files once status shows completed.
- Click Download packages to retrieve your
.pstarchives directly through your browser to your local workstation.
Package Retention Policy: Microsoft Purview retains search export packages for 14 days. After 14 days, the exported files are purged from cloud storage and the export must be regenerated.
Official Microsoft Learn reference: Export Content Search results in the Microsoft Purview portal (Verified October 2026).
Method 2: PowerShell Script Automation for Content Search Creation
For administrators managing repeated searches or bulk operations, you can script the creation and execution of the Content Search using Exchange Online PowerShell:
Step 1: Connect to Security & Compliance PowerShell
# Install Exchange Online Management V3 module (if needed)
Install-Module -Name ExchangeOnlineManagement -Force -AllowClobber
# Connect to Microsoft Purview Compliance Endpoint
Import-Module ExchangeOnlineManagement
Connect-IPPSSession -UserPrincipalName admin@yourdomain.comStep 2: Define and Start the Content Search
# Create Content Search targeting specific mailbox
New-ComplianceSearch -Name "M365_Export_User" `
-ExchangeLocation "user@yourdomain.com" `
-AllowNotFoundExchangeLocationsEnabled $true
# Start Search Indexing
Start-ComplianceSearch -Identity "M365_Export_User"Step 3: Monitor Search Status
# Check Search Status (Wait for Status: Completed)
Get-ComplianceSearch -Identity "M365_Export_User" | Select-Object Name, Status, Items, SizeOnce the search status returns Completed, navigate to the Microsoft Purview portal (https://purview.microsoft.com) to trigger the export and download the resulting PST file via the Process Manager as described in Method 1.
Technical Note: Status of Legacy ClickOnce eDiscovery Export Tool
Older administrative tutorials frequently instructed users to execute New-ComplianceSearchAction -Export, copy a SAS token URL, and launch the ClickOnce-based Microsoft eDiscovery Export Tool.
Administrators should note the official status of this utility:
- Retired Tool: Microsoft has formally retired the standalone ClickOnce eDiscovery Export Tool for standard commercial Microsoft 365 tenants. Modern Microsoft Purview delivers search export packages directly through the web portal interface and cloud download endpoints.
- Obsolete Workflow: Passing SAS tokens to local ClickOnce executables is a legacy workflow preserved only in older on-premises or sovereign cloud configurations (such as Office 365 operated by 21Vianet). Attempting to run legacy ClickOnce workflows in modern M365 tenants will fail.
- Current Procedure: All active commercial tenants must export and retrieve mailbox PST packages using the modern Microsoft Purview portal workflow documented in Method 1.
Method 3: Standalone Direct Mailbox Export via Prism Office 365 Backup Tool
For organizations needing periodic scheduled backups, offboarding archives without Purview license tiers (E3/E5), or environments where administrators want to avoid multi-stage cloud search queues:
The Prism Office 365 Backup Tool connects directly to Microsoft 365 via modern OAuth 2.0 authentication to stream mailboxes into standard Unicode PST archives:
- Open Prism Office 365 Backup Tool on your workstation.
- Select Office 365 and authenticate securely via OAuth 2.0.
- Select target user mailboxes, shared mailboxes, or load a CSV of target accounts.
- Choose PST File as the export format.
- Set optional PST file splitting (e.g., split at 10 GB or 20 GB) to keep archives manageable and prevent oversized files.
- Click Start Export to download PST files directly to local or network storage.
Free Trial Evaluation: The demo edition exports up to 50 items per folder, allowing administrators to verify modern OAuth 2.0 connectivity, folder tree preservation, and PST integrity before purchasing a license.
Technical Comparison: Microsoft Purview vs Prism Migration Engine
| Feature / Metric | Microsoft Purview Content Search | Prism Office 365 Backup Tool |
|---|---|---|
| Primary Interface | Web Portal (purview.microsoft.com) | Standalone Desktop Application |
| Download Mechanism | Modern Purview web download (ClickOnce retired) | Direct client-side streaming via OAuth 2.0 |
| Required Permissions | eDiscovery Manager / Compliance Admin | Standard Admin or User OAuth 2.0 |
| RBAC Setup Propagation | 60–90 minutes cloud directory replication | Immediate upon authentication |
| Output Package Retention | 14 days before automatic cloud deletion | Permanent on local storage |
| Shared Mailbox Selection | Manual location scoping in portal | Interactive mailbox list selection |
| PST Package Sizing | Fixed PST options: 1 GB, 2 GB, 5 GB (default), 10 GB | Custom user-defined splitting |
| ZIP Container Sizing | Fixed ZIP options: 2 GB, 10 GB (default), 20 GB, 40 GB (must be ≥ PST size) | Direct file output (no container needed) |
| Licensing Requirement | Supported M365 Business/Enterprise tier | 1, 2 & 3-Year Term License Options |
Frequently Asked Questions (FAQs)
Q1. Why is New-MailboxExportRequest not recognized in Exchange Online?
New-MailboxExportRequest was designed exclusively for on-premises Exchange Server with local SMB shares. It is not supported in Exchange Online. Microsoft 365 requires using Microsoft Purview Content Search or dedicated mailbox backup tools.
Q2. How long does a Purview Content Search export take?
Small mailboxes (under 5 GB) typically complete search and export packaging within 30 to 60 minutes. Larger mailboxes (20 GB+) can take several hours depending on tenant queue volume and Microsoft service throttling.
Q3. Can I export inactive or litigation hold mailboxes?
Yes. If an employee's mailbox was placed on Litigation Hold or Retention Policy prior to license removal, it is retained as an Inactive Mailbox and can be searched and exported through Microsoft Purview or compatible backup utilities.
Summary
To export an Office 365 mailbox to a PST file natively, use the Microsoft Purview portal (purview.microsoft.com) through the eDiscovery Cases → Searches → select query → Export workflow. Choose Create PSTs for messages (or .msg files), configure data grouping (Organize data from different locations into separate folders or PSTs), and set package sizes (PST: 1 GB, 2 GB, 5 GB default, 10 GB; ZIP: 2 GB, 10 GB default, 20 GB, 40 GB, where ZIP package size must be equal to or greater than the selected PST package size). Retrieve completed packages via Process manager → Export process → Overview → Export packages → Download packages. For direct local archiving without search configuration delays or cloud queue waits, evaluate the Prism Office 365 Backup Tool.
Verified against Microsoft Learn documentation as of October 2026.
Office 365 Backup Tool
Desktop utility engineered for reliable mailbox conversion and data migration.