locked
Help with deleting old mail from user inboxes RRS feed

  • Question

  • Hello all.

    I need some help with an Exchange task.

    We have a small office of about 20 users that is running Exchange 2007. Clients are using Office 2003 SP3.

    We would like to decrease the size of all the users’ .ost files (some are over 5GB), and we would like to achieve that by removing all e-mail that is older than 90 days from the users’ Inbox (and sub-folders), Sent Items, and Deleted Items folders.

    I know that you can set policies in Exchange 2007 for managed folders, but we would like to be able to get rid of all that mail in one session.

    Ideally, we’d like to remove the mail by sending it to a backup database, but if this is not possible, then we’d just like to delete those mails. (We have backups on tape.)

    What’s the easiest way to do this? And if necessary, what commands should we run?

    Thanks in advance

    Thursday, April 14, 2011 5:31 PM

Answers

  • Thank you David and Rich,

    This looks like the easiest way to go. It's only 20 users, so I'll probably remove the mail by policy to a journaling mailbox. From the reading, it looks like I can set the policy to apply/run on the hour.

    I assume that re-creating the OST file should also be fast and easy.

    By the way, I did some digging. Would a command like this also work? 

     

    Get-Mailbox -Server Server1 -ResultSize Unlimited | Export-Mailbox -StartDate "01/01/2006" -EndDate "12/31/2010" -DeleteContent -TargetMailbox MyBackupMailbox -TargetFolder DeleteMsgs

     

    If this kind of command would work, I guess it would be better to run it against each individual user mailbox, then set a target folder for each user in the journaling mailbox.

    My account does have full permission to all the mailboxes.

     

    Thanks again. You guys are great.

    • Marked as answer by Sophia Xu Thursday, April 21, 2011 9:14 AM
    Friday, April 15, 2011 7:42 AM
  • Hi,

    >By the way, I did some digging. Would a command like this also work? 

    It will work.

    The easiest way I think is also to use Export-Mailbox cmdlet. Using it, you can move the contents of a mailbox to a specified mailbox folder and then retain or delete these contents. And you can specify the end date through parameter ENDDATE.

    For more information about Export-Mailbox cmdlet, please refer to the article Export-Mailbox.

    Thanks


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    • Marked as answer by Sophia Xu Thursday, April 21, 2011 9:14 AM
    Monday, April 18, 2011 2:26 AM

All replies

  • My thoughts would be to do this via a Managed Folder Mailbox Policy, although you will have to set the relevant policies up for more than one folder which will take a little time but will achieve what you are setting out to do. Once configured, you then also wont need to touch your config

    http://blogs.technet.com/b/exchange/archive/2006/11/21/3397333.aspx

    I know that this wasnt quite what you were after, I know that you are hoping for a EMS command that achieves this in one command but I dont know of one, I will be interested to see what other people come back with?

    Thursday, April 14, 2011 6:04 PM
  • On Thu, 14 Apr 2011 17:31:21 +0000, kcsega wrote:
     
    >
    >
    >Hello all.
    >
    >I need some help with an Exchange task.
    >
    >We have a small office of about 20 users that is running Exchange 2007. Clients are using Office 2003 SP3.
    >
    >We would like to decrease the size of all the users? .ost files (some are over 5GB), and we would like to achieve that by removing all e-mail that is older than 90 days from the users? Inbox (and sub-folders), Sent Items, and Deleted Items folders.
    >
    >I know that you can set policies in Exchange 2007 for managed folders, but we would like to be able to get rid of all that mail in one session.
    >
    >Ideally, we?d like to remove the mail by sending it to a backup database, but if this is not possible, then we?d just like to delete those mails. (We have backups on tape.)
    >
    >What?s the easiest way to do this? And if necessary, what commands should we run?
     
    MRM is what ou want to use. Once you apply the policy to the mailboxes
    and schedule the MRM execution on the mailbox server(s) it'll all be
    removed pretty quickly.
     
    What _won't_ happen is the .OST file shrinkage. You'll either have to
    create new OST files or run scanpst.exe to shrink the file size after
    the mailbox content is reduced.
     
    ---
    Rich Matheisen
    MCSE+I, Exchange MVP
     

    --- Rich Matheisen MCSE+I, Exchange MVP
    Thursday, April 14, 2011 10:01 PM
  • Thank you David and Rich,

    This looks like the easiest way to go. It's only 20 users, so I'll probably remove the mail by policy to a journaling mailbox. From the reading, it looks like I can set the policy to apply/run on the hour.

    I assume that re-creating the OST file should also be fast and easy.

    By the way, I did some digging. Would a command like this also work? 

     

    Get-Mailbox -Server Server1 -ResultSize Unlimited | Export-Mailbox -StartDate "01/01/2006" -EndDate "12/31/2010" -DeleteContent -TargetMailbox MyBackupMailbox -TargetFolder DeleteMsgs

     

    If this kind of command would work, I guess it would be better to run it against each individual user mailbox, then set a target folder for each user in the journaling mailbox.

    My account does have full permission to all the mailboxes.

     

    Thanks again. You guys are great.

    • Marked as answer by Sophia Xu Thursday, April 21, 2011 9:14 AM
    Friday, April 15, 2011 7:42 AM
  • On Fri, 15 Apr 2011 07:42:09 +0000, kcsega wrote:
     
    >
    >
    >Thank you David and Rich,
    >
    >This looks like the easiest way to go. It's only 20 users, so I'll probably remove the mail by policy to a journaling mailbox. From the reading, it looks like I can set the policy to apply/run on the hour.
    >
    >I assume that re-creating the OST file should also be fast and easy.
    >
    >By the way, I did some digging. Would a command like this also work?
    >
    >Get-Mailbox -Server Server1 -ResultSize Unlimited | Export-Mailbox -StartDate "01/01/2006" -EndDate "12/31/2010" -DeleteContent -TargetMailbox MyBackupMailbox -TargetFolder DeleteMsgs
     
    Yes, it would work, but it'll take a long time and if the PST file
    exceeds 2GB it may lose the information it deletes.
     
    >If this kind of command would work, I guess it would be better to run it against each individual user mailbox, then set a target folder for each user in the journaling mailbox.
    >
    >My account does have full permission to all the mailboxes.
     
    If this is SBS I don't know the answer to the questions, but if you
    can establish a trust between the old and new forests you can just
    move the mailboxes from one Exchange organization to the other.
     
    ---
    Rich Matheisen
    MCSE+I, Exchange MVP
     

    --- Rich Matheisen MCSE+I, Exchange MVP
    Friday, April 15, 2011 11:46 PM
  • Hi,

    >By the way, I did some digging. Would a command like this also work? 

    It will work.

    The easiest way I think is also to use Export-Mailbox cmdlet. Using it, you can move the contents of a mailbox to a specified mailbox folder and then retain or delete these contents. And you can specify the end date through parameter ENDDATE.

    For more information about Export-Mailbox cmdlet, please refer to the article Export-Mailbox.

    Thanks


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    • Marked as answer by Sophia Xu Thursday, April 21, 2011 9:14 AM
    Monday, April 18, 2011 2:26 AM