Others

Copy Mailbox Content Using Exchange Online PowerShell

Rana GarciaRana Garcia Oct 13, 2026 868 views

Question details

The user needs to learn how to search and copy content between different Microsoft Exchange Online mailboxes using PowerShell cmdlets.

How to Copy Mailbox Content Using Exchange Online PowerShell
Product
Microsoft Exchange Online
Device & OS
not provided
Scenario
An IT administrator or user is attempting to perform an email search or migration by copying mailbox content to another mailbox using PowerShell.
Observed behavior
The user is looking for the correct procedure, specifically utilizing the Search-Mailbox cmdlet and seeking appropriate support forums for script execution.
Before you start

Ensure you have the Exchange Online PowerShell module installed and that your administrator account has the necessary permissions, such as the Mailbox Search or Mailbox Import Export role.

Solution 1Recommended

Consult Microsoft Learn for Search-Mailbox Cmdlet

Use the official Microsoft documentation to understand the correct parameters and syntax for copying mailbox data.

The Search-Mailbox cmdlet allows administrators to search a mailbox and copy the results to a specified target mailbox. Because executing PowerShell commands requires strict syntax and elevated permissions, relying on the official Microsoft Learn documentation ensures you use the correct parameters.

1
Connect to Exchange Online

Open your PowerShell terminal as an administrator and connect to Exchange Online using the Connect-ExchangeOnline cmdlet.

2
Access Official Documentation

Navigate to the Microsoft Learn website and search for the 'Search-Mailbox' Exchange PowerShell cmdlet documentation to review the required syntax.

3
Execute the Command

Construct your command using the -TargetMailbox and -TargetFolder parameters to specify where the copied content should be stored, then execute it in your terminal.

4
Seek Community Assistance

If you encounter specific script errors or need further assistance, post your query in the dedicated Microsoft PowerShell for Exchange Online forum.

Consult Microsoft Learn for Search-Mailbox Cmdlet
Cmdlet Deprecation Notice: Depending on your tenant configuration, the Search-Mailbox cmdlet may be deprecated. In such cases, Microsoft recommends using New-ComplianceSearch and New-ComplianceSearchAction.
Free Microsoft Office alternative

Need a Reliable Suite for Your IT Documentation?

While managing Exchange Online requires Microsoft tools like PowerShell, your everyday IT documentation, reporting, and script drafting don't need to rely on expensive subscriptions. WPS Office provides a free, lightweight, and highly compatible alternative.

  1. 1. Download the Software: Visit the official WPS Office website and download the free installation package.
  2. 2. Install WPS Office: Run the setup file and follow the on-screen prompts to complete the lightweight installation.
  3. 3. Start Documenting: Launch WPS Writer or Spreadsheet to begin saving your PowerShell command references and IT administrative guides seamlessly.
Fully compatible with Microsoft Word, Excel, and PowerPoint formats.Lightweight installation that runs smoothly on almost any desktop device.Familiar user interface ensuring seamless migration and zero learning curve.Perfect for drafting PowerShell scripts, maintaining server logs, and creating IT manuals.
microsoft office alternative - wps office

Frequently Asked Questions

What permissions are required to use Search-Mailbox?

You must be assigned the Mailbox Search or Mailbox Import Export management roles in Exchange Online. By default, these roles are not assigned to any administrator group.

What should I do if the Search-Mailbox cmdlet is not recognized?

If the cmdlet is not recognized, verify that you are connected to Exchange Online PowerShell and that your account holds the correct RBAC permissions. Additionally, check if the cmdlet has been deprecated in your specific tenant.

How can I search multiple mailboxes at once?

You can pipe the results of the Get-Mailbox cmdlet into the Search-Mailbox cmdlet to process multiple mailboxes simultaneously, but ensure you test the script on a small batch first.