Copy Mailbox Content Using Exchange Online PowerShell
Question details
The user needs to learn how to search and copy content between different Microsoft Exchange Online mailboxes using PowerShell cmdlets.

- 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.
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.
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.
Open your PowerShell terminal as an administrator and connect to Exchange Online using the Connect-ExchangeOnline cmdlet.
Navigate to the Microsoft Learn website and search for the 'Search-Mailbox' Exchange PowerShell cmdlet documentation to review the required syntax.
Construct your command using the -TargetMailbox and -TargetFolder parameters to specify where the copied content should be stored, then execute it in your terminal.
If you encounter specific script errors or need further assistance, post your query in the dedicated Microsoft PowerShell for Exchange Online forum.

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. Download the Software: Visit the official WPS Office website and download the free installation package.
- 2. Install WPS Office: Run the setup file and follow the on-screen prompts to complete the lightweight installation.
- 3. Start Documenting: Launch WPS Writer or Spreadsheet to begin saving your PowerShell command references and IT administrative guides seamlessly.

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.




