Microsoft Exchange Message Export and Import
I had faced a strange Microsoft Exchange issue last week, messages were getting stuck in the submission queue of an Exchange 2010 SP3 Hub Transport server possibly due to an issue on the Transport Rule Agent. While troubleshooting the issue, since there were a lot of messages in the queue, around two thousands, I decided to export them and import them on the second Hub Transport server. In order to export the messages I used the following command: 1 2 3 4 5 6 7 8 9 10 $messages = Get-Message -Queue "EXCHANGESERVER\Submission" ForEach ( $m in $messages ) { $Temp = "C:\Messages\" + $m .InternetMessageID + ".eml" $Temp = $Temp .Replace( "<" , "_" ) $Temp = $Temp .Replace( ">" , "_" ) $Temp = $Temp .Replace( "\\" , "_" ) Export-Message $m .Identity | AssembleMessage -Path $Temp } I used the Get-Message cmdlet to get all t...