locked
how to delete mailbox content (all current emails in queue) from the ems or the emc. RRS feed

  • Question

  • hello, I have an email account that has high volume of emails. The client is in a bad loop meaning the mailbox is 2 gigs, I increased to 4gigs but it will not take affect till the client sync with the server, it is unable to catch up due to the heavy volume (client trying to catch up take very long time and when I try to autoarchive or setup pst file it hangs) I was researching and found there is a command I can use to delete mailbox content (delete all the emails for that account) and its done in the ems. I tried this command but keep getting errors get-mailbox errormails | export-mailbox - delete content

    it seems my syntex is missing something, I keep getting errors. please let me know what the exact command is to delete emails from the exchange server for that account. or another way to do it in the emc if possible? also what is a good command reference guide for the shell. Thank you for your help.

     

    Monday, January 23, 2012 4:46 PM

Answers

  • I think that's the best solution I have for you under the circumstances. 

    If there's that much volume, using client side rules in an instance of Outlook to process them is probably going to be a brittle solution.  I'd look at scripting that process with Powershell and the EWS managed api.


    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
    • Proposed as answer by Terence Yu Wednesday, January 25, 2012 5:59 AM
    • Marked as answer by Terence Yu Monday, January 30, 2012 9:30 AM
    Monday, January 23, 2012 6:02 PM

All replies

  • Your question is kind of ambiguous.  Are you wanting to delete emails from the mailbox that have already been delivered, or emails in the transport queues waiting for the mailbox to be able to accept new email?


    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
    • Edited by mjolinor Monday, January 23, 2012 4:52 PM
    Monday, January 23, 2012 4:52 PM
  • sorry, transport queue for that account only.
    Monday, January 23, 2012 4:54 PM
  • What version of Exchange?  If it's 2010, fire up the EMC and go to the Toolbox and find the Queue Viewer.
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
    Monday, January 23, 2012 4:55 PM
  • 2010, it does not stay long enough in queue to stop emails from continuing to mailbox. I might not be explaining this right but here is more details.

    I have a email account called errormails that gets a lot of emails it is just used to check some of them now and then, thats why its ok to delete them from time to time and in this case to get the account back to where it suppose to be. The mailbox size is 2gigs I set it to 4gigs but currently I am getting on the client "your mailbox is full you cant send or receive messages, updating inbox" The quota size has not taken effect due to the account is not in sync with the exchange server. I took the client of line deleted all the mails in the inbox, sent folder and delete folder, these are the only folders) The process for the client to catch up is taking a very long time hole day etc. due to the heavy volume of emails that come into that account. How do I get this account back to normal asap, and how do I prevent it from happing again?

    Monday, January 23, 2012 5:08 PM
  • Add a hub transport rule to drop all emails to that address.  That will get the backlog out of the queues as soon as they hit their next retry cycle. 

    As far as keeping it from happening again, it would help to know what caused it.


    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
    Monday, January 23, 2012 5:12 PM
  • are you sure the hub trasnport rule is the way to go?

    what caused it is the volume of emails that come into that account and the client mailbox gets maxed out, normally my autoarchive to only keep a days emails works but the volume broke that and broke the rules I have setup (way to many conflicting emails outlook does not know what to do) I am thinking I am thinking on the client side a rule put the emails to a pst file as soon as they come in and then set a autoarchive to delete the emails from the pst file after 2 days.

    Monday, January 23, 2012 5:49 PM
  • I think that's the best solution I have for you under the circumstances. 

    If there's that much volume, using client side rules in an instance of Outlook to process them is probably going to be a brittle solution.  I'd look at scripting that process with Powershell and the EWS managed api.


    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
    • Proposed as answer by Terence Yu Wednesday, January 25, 2012 5:59 AM
    • Marked as answer by Terence Yu Monday, January 30, 2012 9:30 AM
    Monday, January 23, 2012 6:02 PM