Udostępnij za pośrednictwem


How to Remove Messages from Queues

Microsoft Exchange Server 2007 will reach end of support on April 11, 2017. To stay supported, you will need to upgrade. For more information, see Resources to help you upgrade your Office 2007 servers and clients.

 

Applies to: Exchange Server 2007, Exchange Server 2007 SP1, Exchange Server 2007 SP2, Exchange Server 2007 SP3

This topic explains how to use the Exchange Queue Viewer or the Exchange Management Shell to remove one or more messages that are in a queue that is on a computer that has the Microsoft Exchange Server 2007 Hub Transport server role or the Edge Transport server role installed.

A message that is being sent to multiple recipients might be located in more than one queue. To remove a message from more than one queue in a single operation, you must use a filter.

You can select whether to send a non-delivery report (NDR) when you remove messages from a queue. You cannot remove a message from the Submission queue.

Before You Begin

To perform the following procedures, the account you use must be delegated the following:

  • Exchange Server Administrator role

To perform the following procedures on a computer that has the Edge Transport server role installed, you must log on by using an account that is a member of the local Administrators group on that computer.

For more information about permissions, delegating roles, and the rights that are required to administer Exchange Server 2007, see Permission Considerations.

Before you remove a message from a queue, you must follow these steps:

  • Verify that you are connected to an Exchange transport server. By default, the actions of the Queue Viewer or the Exchange Management Shell focus on the local server. For more information, see How to Connect to a Server by Using the Queue Viewer.

  • To connect to a specific transport server when you are using the Exchange Management Shell, include the Server parameter with a filter statement, or include the server name when you specify the message identity.

  • Verify that you have configured the Queue Viewer options. These options determine the number of items that are displayed per page and the frequency at which the Queue Viewer updates the display. For more information, see How to Set Queue Viewer Options.

Procedure

To use the Queue Viewer to remove a message from a queue

  1. Open the Exchange Management Console.

  2. In the console tree, click Toolbox.

  3. In the result pane, click Exchange Queue Viewer.

  4. In the action pane, click Open Tool.

  5. In the Queue Viewer, click the Messages tab. A list of all messages on the server to which you are connected is displayed. To adjust the action to a single queue, click the Queues tab, double-click the queue name, and then click the Server\Queue tab that appears.

  6. Select one or more messages from the list, right-click, and then select Remove Messages (with NDR) or Remove Messages (without NDR). A dialog box appears that confirms the selected action and asks, Do you want to continue? Click Yes.

  7. To remove all messages from a particular queue, click the Queues tab. Select a queue, right-click, and select Remove Messages (with NDR) or Remove Messages (without NDR). A dialog box appears that confirms the selected action and asks, Do you want to continue? Click Yes.

    Note

    If you are working with a filtered list, the displayed page may not include all items in the filter. In this case, a prompt will appear that says This action will affect all items on this page. To expand the scope of this action to include all items in this filter, check the following box before you click OK.

To use the Exchange Management Shell to remove a message from a queue

  • Run the following command:

    Remove-message -filter {property -operator "value"} -WithNDR <$true | $false>
    

    The following example uses this syntax to remove messages in the queues that have a subject of "Win Big." The following example does not send a NDR:

    Remove-message -filter {Subject -eq "Win Big"} -WithNDR false
    

For detailed syntax and parameter information, see Remove-Message.

For More Information

For more information, see the following topics: