Anavem
Languagefr
How to Export Exchange Mailbox to PST File Using PowerShell

How to Export Exchange Mailbox to PST File Using PowerShell

Export Exchange mailboxes to PST files using PowerShell and Exchange Management Shell with proper RBAC permissions, UNC path configuration, and enterprise-grade methods for data migration and compliance.

Evan MaelEvan Mael
March 27, 2026 15 min
mediumexchange 9 steps 15 min

Why Export Exchange Mailboxes to PST Files?

Exporting Exchange mailboxes to PST files remains a critical task for IT administrators managing data migration, compliance requirements, and backup procedures. Whether you're migrating from on-premises Exchange to Office 365, performing legal discovery, or creating user data archives, understanding the proper export procedures is essential for enterprise environments.

What Are the Current Exchange Export Limitations?

As of 2026, the New-MailboxExportRequest cmdlet is only available for on-premises Exchange Server installations. Microsoft has maintained this limitation for Exchange Online, meaning Office 365 environments cannot use PowerShell-based PST exports. This distinction is crucial for planning your export strategy and understanding which tools apply to your environment.

How Does Exchange Role-Based Access Control Affect PST Exports?

Exchange uses Role-Based Access Control (RBAC) to secure mailbox export operations. The Mailbox Import Export role is not assigned to any role groups by default, requiring explicit assignment before you can perform exports. This security measure prevents unauthorized data extraction and ensures only designated administrators can access mailbox content for export purposes.

What Network Configuration Is Required for PST Exports?

PST exports require specific network share configurations that many administrators overlook. The export process cannot target local folders and must use UNC network paths with precise permissions for the Exchange Trusted Subsystem and SYSTEM accounts. Understanding these requirements prevents the most common export failures and ensures reliable data transfer to your designated storage location.

Implementation Guide

Full Procedure

01

Assign Mailbox Import Export Role

Before you can export mailboxes to PST files, you need the Mailbox Import Export role. This role is not assigned to any role groups by default, so you must explicitly assign it to your user account.

Open Exchange Management Shell as an administrator and run this command:

New-ManagementRoleAssignment –Role "Mailbox Import Export" –User "yourusername"

Replace yourusername with your actual username. For example:

New-ManagementRoleAssignment –Role "Mailbox Import Export" –User "administrator"

Verification: Check your role assignments with:

Get-ManagementRoleAssignment -RoleAssignee "yourusername" | Where-Object {$_.Role -like "*Import*"}
Pro tip: You can assign this role to a role group instead of individual users for better management: New-ManagementRoleAssignment –Role "Mailbox Import Export" –RoleGroup "Organization Management"
02

Create and Configure Network Share

PST exports cannot target local folders like C:\PSTExports. You must create a UNC network path (shared folder) that Exchange Server can access.

Create a folder on your Exchange server or file server:

New-Item -Path "D:\PST" -ItemType Directory
New-SmbShare -Name "PST" -Path "D:\PST" -FullAccess "Everyone"

Configure the required permissions on the shared folder. The Exchange Trusted Subsystem group needs Change/Read permissions, and SYSTEM needs Full Control:

# Set folder permissions
$acl = Get-Acl "D:\PST"
$accessRule1 = New-Object System.Security.AccessControl.FileSystemAccessRule("Exchange Trusted Subsystem","Modify","ContainerInherit,ObjectInherit","None","Allow")
$accessRule2 = New-Object System.Security.AccessControl.FileSystemAccessRule("SYSTEM","FullControl","ContainerInherit,ObjectInherit","None","Allow")
$acl.SetAccessRule($accessRule1)
$acl.SetAccessRule($accessRule2)
Set-Acl "D:\PST" $acl

Verification: Test the UNC path from Exchange Management Shell:

Test-Path "\\$env:COMPUTERNAME\PST"
Warning: Never use local paths like C:\PST. Exchange export requests will fail with "Access denied" errors if you don't use a proper UNC path.
03

Export Single Mailbox to PST

Now you can export a single mailbox using the New-MailboxExportRequest cmdlet. This is the most common scenario for individual mailbox exports.

Use this basic syntax to export a mailbox:

New-MailboxExportRequest -Mailbox "username" -FilePath "\\servername\share\username.pst"

Here's a practical example:

New-MailboxExportRequest -Mailbox "amanda.morgan" -FilePath "\\EX01-2016\PST\amanda.morgan.pst"

You should see output similar to this:

Name              Mailbox                                    Status
----              -------                                    ------
MailboxExport     company.local/Users/Amanda Morgan          Queued

Verification: Check the export request status:

Get-MailboxExportRequest -Mailbox "amanda.morgan" | Format-List Name,Mailbox,Status,PercentComplete

Monitor progress until Status shows "Completed". Large mailboxes may take several hours to export.

Pro tip: Add a custom name to your export request for easier tracking: New-MailboxExportRequest -Name "Amanda_Backup_2026" -Mailbox "amanda.morgan" -FilePath "\\EX01-2016\PST\amanda.morgan.pst"
04

Export Archive Mailbox

If your organization uses archive mailboxes, you can export them separately using the -IsArchive parameter. This is essential for complete data migration or compliance requirements.

Export an archive mailbox with this command:

New-MailboxExportRequest -Mailbox "username" -FilePath "\\servername\share\username_archive.pst" -IsArchive

Practical example:

New-MailboxExportRequest -Name "Amanda_Archive_Export" -Mailbox "amanda.morgan" -FilePath "\\EX01-2016\PST\amanda.morgan_archive.pst" -IsArchive

You can also export both primary and archive mailboxes simultaneously by running two separate commands:

# Export primary mailbox
New-MailboxExportRequest -Name "Amanda_Primary" -Mailbox "amanda.morgan" -FilePath "\\EX01-2016\PST\amanda.morgan_primary.pst"

# Export archive mailbox
New-MailboxExportRequest -Name "Amanda_Archive" -Mailbox "amanda.morgan" -FilePath "\\EX01-2016\PST\amanda.morgan_archive.pst" -IsArchive

Verification: Check if the user has an archive mailbox first:

Get-Mailbox "amanda.morgan" | Select-Object Name,ArchiveStatus,ArchiveDatabase

Then monitor both export requests:

Get-MailboxExportRequest | Where-Object {$_.Mailbox -like "*amanda.morgan*"} | Format-Table Name,Status,PercentComplete
05

Export with Date Range Filtering

For compliance or data retention purposes, you often need to export only specific date ranges. Use the ContentFilter parameter to specify date criteria.

Export emails within a specific date range:

New-MailboxExportRequest -ContentFilter {(Received -lt '03/09/2026') -and (Received -gt '03/09/2025')} -Mailbox "amanda.morgan" -FilePath "\\EX01-2016\PST\amanda.morgan_2025.pst"

You can also filter by other criteria like sender, subject, or message size:

# Export only emails from specific sender
New-MailboxExportRequest -ContentFilter {From -like "*@contoso.com"} -Mailbox "amanda.morgan" -FilePath "\\EX01-2016\PST\amanda_contoso_emails.pst"

# Export emails larger than 10MB
New-MailboxExportRequest -ContentFilter {MessageSize -gt '10MB'} -Mailbox "amanda.morgan" -FilePath "\\EX01-2016\PST\amanda_large_emails.pst"

# Export emails with specific subject
New-MailboxExportRequest -ContentFilter {Subject -like "*Project Alpha*"} -Mailbox "amanda.morgan" -FilePath "\\EX01-2016\PST\amanda_project_alpha.pst"

Verification: Test your content filter first to see how many items match:

Get-MailboxStatistics "amanda.morgan" | Get-MailboxFolderStatistics | Where-Object {$_.FolderPath -eq "/Inbox"}
Pro tip: Use PowerShell's Get-Date cmdlet to create dynamic date filters: $LastYear = (Get-Date).AddYears(-1).ToString('MM/dd/yyyy') then use $LastYear in your ContentFilter.
06

Bulk Export Multiple Mailboxes

For enterprise migrations or mass exports, you can export multiple mailboxes simultaneously using PowerShell loops. This method is much more efficient than exporting mailboxes one by one.

Export all mailboxes in your organization:

foreach ($Mailbox in (Get-Mailbox -ResultSize Unlimited)) {
    New-MailboxExportRequest -Mailbox $Mailbox.Identity -FilePath "\\EX01-2016\PST\$($Mailbox.Alias).pst"
}

Export mailboxes from a specific database:

$Mailboxes = Get-Mailbox -Database "Mailbox Database 01"
foreach ($Mailbox in $Mailboxes) {
    $ExportName = "Bulk_Export_" + $Mailbox.Alias
    New-MailboxExportRequest -Name $ExportName -Mailbox $Mailbox.Identity -FilePath "\\EX01-2016\PST\$($Mailbox.Alias).pst"
}

Export mailboxes from a CSV file (useful for selective exports):

# Create CSV file with headers: DisplayName,Alias
# Example content:
# "John Doe","john.doe"
# "Jane Smith","jane.smith"

$Users = Import-Csv "C:\temp\mailboxes_to_export.csv"
foreach ($User in $Users) {
    $ExportName = "CSV_Export_" + $User.Alias
    New-MailboxExportRequest -Name $ExportName -Mailbox $User.Alias -FilePath "\\EX01-2016\PST\$($User.Alias).pst"
}

Verification: Monitor all export requests:

# Check overall progress
Get-MailboxExportRequest | Group-Object Status | Select-Object Name,Count

# Get detailed status
Get-MailboxExportRequest | Format-Table Name,Mailbox,Status,PercentComplete -AutoSize
Warning: Bulk exports can consume significant server resources and network bandwidth. Consider running them during off-hours and limit concurrent exports using the -Priority parameter or by adding Start-Sleep delays between requests.
07

Export Specific Folders and Advanced Filtering

Sometimes you need to export only specific folders or exclude certain folders from the export. Exchange provides granular control over what gets exported.

Export only the Inbox folder:

New-MailboxExportRequest -Mailbox "amanda.morgan" -FilePath "\\EX01-2016\PST\amanda_inbox_only.pst" -IncludeFolders "\Inbox"

Export multiple specific folders:

New-MailboxExportRequest -Mailbox "amanda.morgan" -FilePath "\\EX01-2016\PST\amanda_important_folders.pst" -IncludeFolders "\Inbox","\Sent Items","\Important Projects"

Exclude specific folders (like Deleted Items or Junk Email):

New-MailboxExportRequest -Mailbox "amanda.morgan" -FilePath "\\EX01-2016\PST\amanda_clean_export.pst" -ExcludeFolders "\Deleted Items","\Junk Email","\Drafts"

Combine folder filtering with content filtering:

New-MailboxExportRequest -Mailbox "amanda.morgan" -FilePath "\\EX01-2016\PST\amanda_filtered.pst" -IncludeFolders "\Inbox","\Sent Items" -ContentFilter {(Received -gt '01/01/2025') -and (MessageSize -lt '50MB')}

Export to a specific folder structure in the PST:

New-MailboxExportRequest -Mailbox "amanda.morgan" -FilePath "\\EX01-2016\PST\amanda_structured.pst" -SourceRootFolder "\Inbox" -TargetRootFolder "\Amanda_Inbox_Backup"

Verification: List all folders in a mailbox to identify correct folder paths:

Get-MailboxFolderStatistics "amanda.morgan" | Select-Object FolderPath,ItemsInFolder | Sort-Object FolderPath
08

Monitor and Manage Export Requests

Proper monitoring of export requests is crucial for enterprise environments. Exchange provides several cmdlets to track progress and manage ongoing exports.

Check the status of all export requests:

Get-MailboxExportRequest | Format-Table Name,Mailbox,Status,PercentComplete,BytesTransferred -AutoSize

Get detailed information about a specific export:

Get-MailboxExportRequest -Name "Amanda_Backup_2026" | Format-List *

View export statistics and progress:

Get-MailboxExportRequestStatistics -Identity "Amanda_Backup_2026" | Format-List Name,Status,PercentComplete,BytesTransferred,ItemsTransferred,EstimatedTransferSize

Remove completed export requests (cleanup):

# Remove specific completed request
Remove-MailboxExportRequest -Identity "Amanda_Backup_2026" -Confirm:$false

# Remove all completed requests
Get-MailboxExportRequest -Status Completed | Remove-MailboxExportRequest -Confirm:$false

Cancel a running export request:

# Suspend the request first
Suspend-MailboxExportRequest -Identity "Amanda_Backup_2026"

# Then remove it
Remove-MailboxExportRequest -Identity "Amanda_Backup_2026" -Confirm:$false

Resume a suspended export:

Resume-MailboxExportRequest -Identity "Amanda_Backup_2026"

Verification: Create a monitoring script that runs periodically:

# Save as Monitor-Exports.ps1
do {
    Clear-Host
    Write-Host "Export Status - $(Get-Date)" -ForegroundColor Green
    Get-MailboxExportRequest | Group-Object Status | Format-Table Name,Count -AutoSize
    Get-MailboxExportRequest | Where-Object {$_.Status -eq "InProgress"} | Format-Table Name,PercentComplete,BytesTransferred -AutoSize
    Start-Sleep 30
} while ((Get-MailboxExportRequest | Where-Object {$_.Status -eq "InProgress"}).Count -gt 0)
Pro tip: Set up email notifications for completed exports by adding this to your monitoring script: Send-MailMessage -To "admin@company.com" -From "exchange@company.com" -Subject "Export Completed" -Body "Export $ExportName has finished" -SmtpServer "mail.company.com"
09

Troubleshoot Common Export Issues

Export operations can fail for various reasons. Here are the most common issues and their solutions, based on real-world troubleshooting experience.

Issue 1: Permission Denied Errors

If you get "You don't have permission" errors, verify your role assignment:

# Check current role assignments
Get-ManagementRoleAssignment -RoleAssignee $env:USERNAME | Where-Object {$_.Role -like "*Import*"}

# If no results, assign the role again
New-ManagementRoleAssignment –Role "Mailbox Import Export" –User $env:USERNAME

Issue 2: UNC Path Access Denied

Verify the network share permissions and test connectivity:

# Test UNC path access
Test-Path "\\EX01-2016\PST"

# Check share permissions
Get-SmbShareAccess -Name "PST"

# Verify folder permissions
Get-Acl "D:\PST" | Format-List

Issue 3: Export Stuck in Queued Status

Check the Microsoft Exchange Mailbox Replication service:

# Check service status
Get-Service MSExchangeMailboxReplication

# Restart if needed
Restart-Service MSExchangeMailboxReplication

# Check MRS configuration
Get-MailboxServer | Get-MailboxReplicationService

Issue 4: Large Mailbox Export Failures

For mailboxes larger than 50GB, use these parameters:

New-MailboxExportRequest -Mailbox "large.mailbox" -FilePath "\\EX01-2016\PST\large_mailbox.pst" -Priority High -LargeItemLimit 100 -BadItemLimit 50

Issue 5: Exchange Online Limitation

Remember that Exchange Online doesn't support PST exports via PowerShell. For Office 365, use these alternatives:

- Microsoft 365 Security & Compliance Center (Content Search)
- Microsoft Purview eDiscovery
- Third-party migration tools
- Outlook client export (for individual users)

Verification: Test your export setup with a small test mailbox first:

# Create test mailbox
New-Mailbox -Name "TestExport" -UserPrincipalName "testexport@company.com" -Password (ConvertTo-SecureString "TempPass123!" -AsPlainText -Force)

# Test export
New-MailboxExportRequest -Mailbox "TestExport" -FilePath "\\EX01-2016\PST\test_export.pst"
Warning: Never attempt to export directly to local drives (C:\, D:\) from Exchange Management Shell. This will always fail. Always use UNC paths (\\servername\share) for PST exports.

Frequently Asked Questions

Can I export Exchange Online mailboxes to PST files using PowerShell?+
No, Exchange Online does not support PST exports via PowerShell or the New-MailboxExportRequest cmdlet. This functionality is only available for on-premises Exchange Server installations. For Office 365 environments, you must use the Microsoft 365 Security & Compliance Center, Microsoft Purview eDiscovery, or third-party migration tools to export mailbox data.
Why does my PST export fail with 'Access Denied' when using local paths?+
Exchange PST exports cannot target local folders like C:\PST or D:\Exports. You must use UNC network paths (\\servername\share) because the Exchange Mailbox Replication Service runs under the Exchange Trusted Subsystem account, which requires network share access. Create a shared folder with proper permissions for Exchange Trusted Subsystem (Change/Read) and SYSTEM (Full Control) accounts.
How long does it take to export a large Exchange mailbox to PST?+
Export time depends on mailbox size, server performance, and network bandwidth. A typical 10GB mailbox takes 2-4 hours, while 50GB+ mailboxes can take 12-24 hours or more. Factors affecting speed include disk I/O performance, network latency to the UNC share, server load, and concurrent export operations. Monitor progress using Get-MailboxExportRequestStatistics to track BytesTransferred and PercentComplete.
What permissions do I need to export Exchange mailboxes to PST files?+
You need the 'Mailbox Import Export' role explicitly assigned to your user account or role group. This role is not assigned by default to any Exchange role groups for security reasons. Use New-ManagementRoleAssignment –Role 'Mailbox Import Export' –User 'username' to assign the role. Additionally, you need administrative access to create and configure the network share with proper NTFS and share permissions.
Can I export multiple Exchange mailboxes simultaneously to separate PST files?+
Yes, you can run multiple export requests simultaneously using PowerShell loops or individual New-MailboxExportRequest commands. Exchange handles concurrent exports through the Mailbox Replication Service (MRS). However, too many concurrent exports can impact server performance. Consider using the -Priority parameter to manage resource allocation and monitor server performance during bulk export operations to avoid overwhelming your Exchange infrastructure.
Evan Mael
Written by

Evan Mael

Microsoft MCSA-certified Cloud Architect | Fortinet-focused. I modernize cloud, hybrid & on-prem infrastructure for reliability, security, performance and cost control - sharing field-tested ops & troubleshooting.

Discussion

Share your thoughts and insights

Sign in to join the discussion