Exporting messages from mail queues on Exchange 2010/2013/2016

UPDATE: This post was updated on August 11, 2016.

When a company migrates mailboxes between Exchange servers, they run the risk of losing emails that were in message queues. The gravity of this problem increases with the size of the organization and the amount of mail traffic – when hundreds of emails are sent every hour, the danger of overlooking them during the switch is quite high.

Fortunately, a simple PowerShell script is all you need to avoid the setback. It is even useful as a final checkup measure before decommissioning the old server. Below you’ll find steps required to perform this task.


First, launch the Exchange Management Shell or connect to your server remotely using the PowerShell console.

Run the following command to suspend all messages in all queues on your server. Only suspended messages can be exported.

Get-Queue | Get-Message | Suspend-Message

Next retrieve all messages from your queues:

$MailExport = Get-Message

Before saving exported messages on the hard drive, make sure to create a folder for their storage, e.g. c:\queuexport.

Use the following command to export messages:

$MailExport | ForEach-Object {$temporary="C:\queuexport\"+$_.fromaddress+"_"+$_.subject+".eml"; export-message $_.identity | assemblemessage -path $temporary}

All messages found in all queues are saved to the C:\queuexport folder in the standard EML format with file names consisting of the sender’s email address, the message’s subject.

You can then easily import these emails into Outlook by simply dragging and dropping them in any mail folder.

The procedure is compatible with Exchange 2010, Exchange 2013 and Exchange 2016.

2 thoughts on “Exporting messages from mail queues on Exchange 2010/2013/2016

  1. Thanks for sharing this informative post. I believe that this post will definitely solve the problems and issues related to migration of emails. Moreover, this is a manual method which doesn’t involve any cost for migration.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>