Export Messages from Transport Queue

Exchange Server 2013Exchange Server 2016Description

This script helps to suspend all messages in an Exchange transport queue and to export all suspended messages to a given target folder.

The script properly uses the AssembleMessage cmdlet to export queued messages as .eml files.

Optionally, all exported messages can be removed from the transport queue. 

Note

This script requires the GlobalFunctions module for logging.

Examples

# EXAMPLE 1
# Export messages from queue MCMEP01\45534 to D:\ExportedMessages and do not delete messages after export
.\Export-MessageQueue -Queue MCMEP01\45534 -Path D:\ExportedMessages

# EXAMPLE 2
# Export messages from queue MCMEP01\45534 to D:\ExportedMessages and delete messages after export
.\Export-MessageQueue -Queue MCMEP01\45534 -Path D:\ExportedMessages -DeleteAfterExport

Version History

  • 1.0, Initial community release
  • 1.1, Some PowerShell hygiene 

As always: Test and familiarize yourself with the script in a test or development environment.

Links

Follow

%d Bloggern gefällt das: