Export all messages in queue – Exchange 2010

We had a small communication issue on one of our Edge servers and noted that some messages simply weren’t sending and were stuck in the queue.  There are various articles about how to export these but I thought I would lock it down to help anyone looking for a end to end how-to.  So in this scenario we have 2 edge servers – one functioning and one not.
Using the Exchange Management Shell – running as Admin:
Get-Message -Server stfsr253 | ForEach-Object {$Temp=”<LocalDrive>Export”+$_.InternetMessageID+”.eml”;$Temp=$Temp.Replace(“<“,”_”);$Temp=$Temp.Replace(“>”,”_”);Export-Message $_.Identity | AssembleMessage -Path $Temp}
Note this folder must exist before running the above.
Grab the exported messages from your folder and paste them into the pickup folder on your working edge server, usually found:
<InstallDrive>Program FilesMicrosoftExchange ServerV14TransportRolesPickup
Give it a minute or two and check your queue on the working edge server – your messages should have sent.

About the author