Tuesday, September 4, 2012

Move Messages to Another Working Queue

In the event a Hub Transport server is completely out, you may have the requirement to move all messages in a queue to another Hub Transport server in your organisation to ensure the messages are delivered.  How can you do this?

First you need to export all messages in the current queue.  You can do this with the following powershell commands:

$array = @(Get-Message -Queue "QueueName" -ResultSize unlimited)

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

To import the messages into the new Hub Transport server, simply place the .eml files into the Transport Pickup folder.  The new server should immediately start processing the messages.

3 comments:

  1. This was really useful! I would however like to say that you have to suspend all messages in that queue before you can export them (Powershell "Suspend-Message" alternatively in EMC, go to queues, messages and select one or more, and click suspend)

    ReplyDelete
  2. Thanks for this post. Its very helpul!

    ReplyDelete
  3. Super post. easiest solution I've seen. Many thanks - Matt

    ReplyDelete