none
Need to have procedure to drain the queues RRS feed

  • Question

  • I'm looking for a procedure to be able to drain my queues.

    I found a link https://blogs.technet.microsoft.com/nawar/2014/03/30/exchange-2013-maintenance-mode/ that mentions to run "Set-ServerComponentState <ServerName> -Component HubTransport -State Draining -Requester Maintenance" to drain the queues. 

    Is this just putting into maintenance mode, or is it draining the queues and putting it in maintenance mode?

    Little confused here.

    thanks 

    Monday, January 8, 2018 4:19 PM

Answers

  • I'm looking for a procedure to be able to drain my queues.

    I found a link https://blogs.technet.microsoft.com/nawar/2014/03/30/exchange-2013-maintenance-mode/ that mentions to run "Set-ServerComponentState <ServerName> -Component HubTransport -State Draining -Requester Maintenance" to drain the queues. 

    Is this just putting into maintenance mode, or is it draining the queues and putting it in maintenance mode?

    Little confused here.

    thanks 

    Before putting the server in Maint mode, redirect the existing messages to another server to drain them with Redirect-Message

    Monday, January 8, 2018 7:49 PM
    Moderator

All replies

  • The cmdlet would not drain the queues but would disable the connections to the specific component you are refering, These cmdlets are normally used when there multiple servers & you are performing some kind of maintenance in a staggered mode.


    If you want to remove the messages based on some filter, you use shell cmdlet below orYou can also try the MMC.
    Get-TransportServer | Get-Queue | Get-Message -ResultSize unlimited | where {$_.Subject -like "*XXXXX*"} | Remove-Message -WithNDR $False

    If you want to remove all the messages in the queue, You can rename it.

    Stop the Microsoft Exchange Transport Service
    Navigate to the queue folder folder (default location C:\Program Files\Microsoft\Exchange Server\V15\TransportRoles\data\Queue)
    Rename the Queue folder to Queue.old
    Start the Microsoft Exchange Transport Service
    This should create a new Queue folder with new mail.que DB.You can then delete the old Queue folder if required.

    Regards,
    Fazal

    Disclaimer: The views expressed on this blog are my own and do not necessarily reflect the views of my employer.

    Monday, January 8, 2018 7:33 PM
  • I'm looking for a procedure to be able to drain my queues.

    I found a link https://blogs.technet.microsoft.com/nawar/2014/03/30/exchange-2013-maintenance-mode/ that mentions to run "Set-ServerComponentState <ServerName> -Component HubTransport -State Draining -Requester Maintenance" to drain the queues. 

    Is this just putting into maintenance mode, or is it draining the queues and putting it in maintenance mode?

    Little confused here.

    thanks 

    Before putting the server in Maint mode, redirect the existing messages to another server to drain them with Redirect-Message

    Monday, January 8, 2018 7:49 PM
    Moderator
  • Hi,

    Based on my knowledge, the command you provided will mark the state as "Draining" and put the component into maintenance mode, we need to run the following command to drain the queue:

    Redirect-Message -Server <ServerName> -Target <MailboxServerFQDN>

    Similar link: Drain the mail queues on the server

    Regards,

    Manu Meng


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.

    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Tuesday, January 9, 2018 8:59 AM
    Moderator