We help IT Professionals succeed at work.

Exchange 2007 Queue is Full

jaelae asked
Medium Priority
Last Modified: 2012-05-06
Our Exchange 2007 server has a ton of e-mail stuck in the submission queue that are mostly undeliverables - or ones that keep being rejected.  We currently have just over 107,000 and any powershell scripts I run are not deleting messages i specify.  It seems that all legit e-mail is going through (though slightly delayed).  Is there a way to dump the entire queue?

The reason it got so big was because had an open relay which has now been resolved.
Watch Question

Expert of the Quarter 2009
Expert of the Year 2009

The first thing I would suggest you do is run this command to stop new messages coming in:

Net Pause MSExchangeTransport

Then create a new folder called "QueueDump" on the C drive and run this command:

Get-Message -Queue "Unreachable" | Export-Message -Path C:\QueueDump

That should dump most of the messages in to the folder.
You can then hard delete the folder (SHIFT DEL). If you try and open the folder Explorer will probably hang.

If there are messages that you don't want in other types of queues, then you should be able to change the "Unreachable" for the other types of queues. Can't remember if that does actually work though at this time of night (it is 11.40pm here).

Which error did you make to turn the server in to an open relay? I was just updating my article on the open relay for Exchange 2007, so I am curious what people are doing (even in error) in the field.



Well I am on the right track now.  I tried to run:
Get-Message -Queue "*" | Export-Message -Path C:\QueueDump

Since it is all junk right now and in tons of queues.  However I get the error that I cannot move messages that are not suspended.  Is there a powershell script that I can run that will suspend every queue?  I can do it in the GUi but page by page (1000 at a time).
Expert of the Quarter 2009
Expert of the Year 2009

Did you pause the transport using the command I stated?
Rather than use *, use the specific queue names, see if you can get the bulk of the email out by using those.

As for suspending the queues using EMS, it is unsurprisingly suspend-queue



Mestha -

Yes I used that commant which paused the transport - but it didn't make the messages go to suspended.  Also, there are over 4000 queues (with over 105,000 messages) - so i couldn't do specific queue names.
Expert of the Quarter 2009
Expert of the Year 2009
The queue names are types - so you should have a queue called Unreachable.


Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts


Mestha - No queue was called UNreachable - it didn't get to that point..  It seemed like it created thousands of queues to send Unreachable messages out to everyone.  I ended up clearing the entire queue by doing this:
remove-message -server "servername" -filter {FromAddress -like "*"} -withNDR $false

Then I deleted all SMTP Queues by doing:
- Stop exchange transport
- delete everything where mail.que is stored
- Start Exchange Transport
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.