Exchange Server Share

… Information sharing on Exchange Server …

Exchange Powershell Tip #12

Exchange Powershell Tip #12
How do I export specific messages from the Transport Queue?

Many times we need to export a message from the queue for various reasons, like if it is sitting in the queue for a while, message in the poison queue (wonder why is that) or a message in the queue waiting for any third-party Transport agent to get processed etc…

I would always start filtering output in Exchange Shell to see what it gives back. For example, if I want to export the messages from the queue with From Address = then I would run below cmdlet to get the result on screen.

Get-Message -Server ex2016-01 -Filter {FromAddress -like “Exadmin2016*”} -ResultSize Unlimited

Once It gives desired result then I would go ahead and export the messages using below cmdlet. You can always change filter to meet your requirement and the folder path where you want to export the messages. These messages will be exported in plain eml format so you can read them in notepad or Outlook.

Get-Message -Server ex2016-01 -Filter {FromAddress -like “Exadmin2016*”} -ResultSize Unlimited | ForEach-Object {Suspend-Message $_.Identity -Confirm:$False; $Temp=”C:\temp\”+$_.InternetMessageID+”.eml”; $Temp=$Temp.Replace(“”,”_”); Export-Message $_.Identity | AssembleMessage -Path $Temp}


==> Get All Exchange Powershell Tips from the Archive Here<==


Written by Amit Tank

October 11, 2016 at 9:43 pm

%d bloggers like this: