Monday 7 November 2016

Exchange 2010 - Move Messages to Another Working Queue

If you ever had a problem with 'stuck' email messages in a queue, you would find this helpful.
I had a problem where I had 2 send connectors set up:
1. For an external archiving solution
2. "live" send/receive send connector

Some emails were stuck in the "live" queue, because of the message size, because the "archiver" connector could not send them out.

To move these email messages from the "live" queue to the "archiver" queue, I had to run the following command in EMC:
$array = @(Get-Message -Queue "QueueName" -ResultSize unlimited)

$array | ForEach-Object {$i++;Export-Message $_.Identity | AssembleMessage -Path ("c:\temp\"+ $i +".eml")}

Make sure to enable scripting on your exchange - Set-ExecutionPolicy unrestricted

Once exported, you can move these .eml files to your exchange transport pickup folder. 
On Exchange 2010, it is normally located at: C:\Program Files\Microsoft\Exchange Server\V14\TransportRoles\Pickup

No comments:

Post a Comment