Exchange Server Share

… Information sharing on Exchange Server …

Exchange Powershell Tip #12

leave a comment »

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 = ExAdmin2016@ExchangeServerShare.com 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}

image

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

Written by Amit Tank

October 11, 2016 at 9:43 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: