Exportation de messages de files d'attente

[Cette rubrique est une documentation préliminaire et peut être modifiée dans les versions ultérieures. Des rubriques vides sont incluses comme espaces réservés. N’hésitez pas à nous transmettre vos commentaires. Envoyez-nous un e-mail à l’adresse ExchangeHelpFeedback@microsoft.com.]  

S’applique à :Exchange Server 2016

Learn how to export messages from queues in Exchange 2016.

On Mailbox servers and Edge Transport servers in Exchange Server 2016, you can export the messages in a queue to files. The exported messages aren't removed from the queue. Copies of the messages are made in the specified location as a plain text files. You can view the message files in Notepad or Outlook, and you can resubmit the message files by using the Replay directory on any other Mailbox server or Edge Transport server inside or outside your Exchange organization.

  • Estimated time to complete each procedure: 5 minutes

  • Des autorisations doivent vous être attribuées avant de pouvoir exécuter cette procédure. Pour voir les autorisations qui vous sont nécessaires, consultez "Queues" entry in Autorisations de flux de messagerie topic.

  • To export messages from a delivery queue, the Submission queue, or the Unreachable queue, the messages need to be in the Suspended state. For active, healthy queues, you first suspend the queue so you can then suspend the messages. Messages in the poison message queue are already in the Suspended state. For more information, see Suspend queues and Suspend messages in queues.

  • You can't use Queue Viewer in the Boîte à outils Exchange to export messages. However, you can use Queue Viewer to locate, identify, and suspend the messages before you export them using the Environnement de ligne de commande Exchange Management Shell. For more information about Queue Viewer, see Afficheur des files d’attente. Pour en savoir plus sur l’ouverture de l’environnement de ligne de commande Exchange Management Shell dans votre organisation Exchange locale, consultez la rubrique Ouverture de l’environnement de ligne de commande Exchange Management Shell.

  • When you export messages from a queue, you don't remove the messages from the queue. If you resubmit the exported messages by using the Replay directory, you should remove the messages from the queue to avoid duplicate message delivery. For more information, see Remove messages from queues.

  • Verify the following information about the target location for the exported message files:

    • The target folder needs to exist before you export any messages, and won't be created for you. If you don't specify the complete path, the files are written to the current Environnement de ligne de commande Exchange Management Shell working directory.

    • The path can be local to the Exchange server, or it can be a UNC path to a share on a remote server (\\server\share).

    • Your account needs to have the Write permission in the target folder.

  • We use the message's InternetMessageID property value for the exported message file names to help ensure uniqueness. The procedures include steps to remove angled brackets (> and <), because they aren't allowed in file names. Also, we use the .eml file name extension so you can easily open the files in Outlook or resubmit the files by using the Replay directory.

  • For more information about identity and filters for queues and messages in queues, see the following topics:

  • Pour des informations sur les raccourcis clavier applicables aux procédures de cette rubrique, voir Raccourcis clavier dans Exchange 2013Raccourcis clavier dans le Centre d’administration Exchange.

tipConseil :
Vous rencontrez des difficultés ? Demandez de l’aide en participant aux forums Exchange. Visitez le forum à l’adresse : Exchange Server, Exchange Online ou Exchange Online Protection.

To export a specific message from a queue, use the following syntax:

Export-Message -Identity <MessageIdentity> | AssembleMessage -Path <FilePath>\<FileName>.eml

This example takes the following actions on the server named Mailbox01:

  1. Suspends the contoso.com delivery queue.

  2. Suspends the message in the queue that has the InternalMessageID value 1234.

  3. Exports a copy of the message to the file D:\contoso Export\export.eml.

Suspend-Queue Mailbox01\contoso.com
Suspend-Message -Identity Mailbox01\contoso.com\1234
Export-Message -Identity Mailbox01\contoso.com\1234 | AssembleMessage -Path "D:\Contoso Export\export.eml"

To export all messages from a queue, and use the InternetMessageID value of each message as the file name, use the following syntax:

Get-Message -Queue <QueueIdentity> -ResultSize Unlimited | ForEach-Object {$Temp=<Path>+$_.InternetMessageID+".eml"; $Temp=$Temp.Replace("<","_"); $Temp=$Temp.Replace(">","_"); Export-Message $_.Identity | AssembleMessage -Path $Temp}

This example takes the following actions on the server named Mailbox01:

  1. Suspends the contoso.com delivery queue.

  2. Suspends all messages in the queue.

  3. Exports copies of the messages to the local folder named D:\Contoso Export.

Suspend-Queue Mailbox01\contoso.com
Get-Queue Mailbox01\contoso.com | Get-Message -ResultSize Unlimited | Suspend-Message
Get-Message -Queue Mailbox01\Contoso.com -ResultSize Unlimited | ForEach-Object {$Temp="D:\Contoso Export\"+$_.InternetMessageID+".eml"; $Temp=$Temp.Replace("<","_"); $Temp=$Temp.Replace(">","_"); Export-Message $_.Identity | AssembleMessage -Path $Temp}

To export specific messages from all queues on a server, and use the InternetMessageID value of each message as the file name, use the following syntax:

Get-Message -Filter {<MessageFilter>} [-Server <ServerIdentity>] -ResultSize Unlimited | ForEach-Object {$Temp=<Path>+$_.InternetMessageID+".eml"; $Temp=$Temp.Replace("<","_"); $Temp=$Temp.Replace(">","_"); Export-Message $_.Identity | AssembleMessage -Path $Temp}

This example takes the following actions on the server named Mailbox01:

  1. Suspends all queues on the server.

  2. Suspends all messages in all queues on the server from senders in the fabrikam.com domain.

  3. Exports copies of the messages to the local folder named D:\Fabrikam Export.

Suspend-Queue -Server Mailbox01
Suspend-Message -Filter {FromAddress -like "*@fabrikam.com"} -Server Mailbox01
Get-Message -Filter {FromAddress -like "*@fabrikam.com"} -Server Mailbox01 -ResultSize Unlimited | ForEach-Object {$Temp="D:\Fabrikam Export\"+$_.InternetMessageID+".eml"; $Temp=$Temp.Replace("<","_"); $Temp=$Temp.Replace(">","_"); Export-Message $_.Identity | AssembleMessage -Path $Temp}

To export all messages from all queues on a server, and use the InternetMessageID value of each message as the file name, use the following syntax:

Get-Message [-Server <ServerIdentity>] -ResultSize Unlimited | ForEach-Object {$Temp=<Path>+$_.InternetMessageID+".eml"; $Temp=$Temp.Replace("<","_"); $Temp=$Temp.Replace(">","_"); Export-Message $_.Identity | AssembleMessage -Path $Temp}

This example takes the following actions on the server named Mailbox01:

  1. Suspends all queues on the server.

  2. Suspends all messages in all queues on the server.

  3. Exports copies of the messages to the local folder named D:\Mailbox01 Export.

Suspend-Queue -Server Mailbox01
Get-Queue -Server Mailbox01 | Get-Message -ResultSize Unlimited | Suspend-Message
Get-Message -Server Mailbox01 -ResultSize Unlimited | ForEach-Object {$Temp="D:\Mailbox01 Export\"+$_.InternetMessageID+".eml"; $Temp=$Temp.Replace("<","_"); $Temp=$Temp.Replace(">","_"); Export-Message $_.Identity | AssembleMessage -Path $Temp}
 
Afficher: