• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1633
  • Last Modified:

Exchange 2007 Queue is Full

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.
0
jaelae
Asked:
jaelae
  • 3
  • 3
1 Solution
 
MesthaCommented:
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.

-M
0
 
jaelaeAuthor Commented:
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).
0
 
MesthaCommented:
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
http://technet.microsoft.com/en-us/library/bb124034.aspx

-M
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 
jaelaeAuthor Commented:
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.
0
 
MesthaCommented:
The queue names are types - so you should have a queue called Unreachable.

-M
0
 
jaelaeAuthor Commented:
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
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now