Excahange 2007 Need to permanently delete all emails older than x years

Cant get to the 2007 forum so don't know if this is the right place.
Trying to permanently delete all mail older than 4 years from our Exchange 2007 server. I have worked with Powershell in 2010 (Exchange) 
but I cannot run due to some restrictions with 32/64 bit powershell limitations in exchange 2007.
I have searched google and these forums -- there has to be an easy way to do this or someone that can point me in the right direction.
Thanks in advance

Hi,
In Exchange 2007, you can use the following cmdlet to delete emails older than the mentioned date from a mailbox.
Export-Mailbox -Identity xxx -StartDate "xx/xx/xxxx" -EndDate "xx/xx/xxxx" -DeleteContent
If you need to perform this on a set of mailboxes, paste all display names to a TXT file, name is as "test.txt". Run the following cmdlet.
Get-Content test.txt | Export-Mailbox -StartDate "xx/xx/xxxx" -EndDate "xx/xx/xxxx" –DeleteContent –Maxthreads 4
Hope this can be helpful to you.
Best regards,
Amy Wang
TechNet Community Support

Similar Messages

  • Why does my iCal delete all events older than a year? Is this a synch issue? I'm running Snow Leopard.

    Why does my iCal delete all events older than a year? Is this a syn issue? I'm running Snow Leopard.

    this has already been answered.
    please ignore my question.

  • How can I set up a rule to delete all messages older than 6 months left in Apple Mail's main inbox?

    How can I set up a rule to delete all messages older than 6 months left in Apple Mail's main inbox?
    I have created other rules to move some of my daily messages into specific folders and I don't wish to auto-delete those.
    Just the general stuff that keeps piling up in my me.com main email box.  Mail such as FB announcements and other low priority stuff I want to look at before deleting but don't want to keep longer than a week or month.
    TIA
    thokitts

    Thanks, but I am looking for a more automated solution than hand marking emails as junk. I might as well move them to the trash myself.
    Again, these are emails I want to receive and quickly read, but not keep longer than a week or month or so. By setting a rule to toss any older than 30 days back then my Mail program (and thus my hard drive) won't be wasting so much space. For example, currently I have over 6000 read messages, with their attachments, in my main email box. I'd rather not have to physically attend to sorting the one I don't want out.
    The one I do keep for other reasons get moved into other folders.
    It seems this should be possible.
    thokitts

  • How to delete daily all idocs older than one year

    Hello
    I wander how to delete daily all idocs older than one year. I guess with an job(but how to create it)

    Hi
    Check this [Link|https://ecohub.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/17c435df-0901-0010-72a7-b9dcd271213d]
    Just give a search in SDN you could find lot of doucments releated to archiving of idocs
    Regards
    Uday

  • How to delete calendar entries older than 2 years without recurring events

    The calendar files get larger and larger and slower and slower
    it would be nice to get rid of old entries
    recurring events that are active for less than 2 years shold NOT be removed

    I wanted that same function for myself, but could not find anything out there to do it. Since I am a professional programmer, I wrote a program in Python to do the job.
    My program has several limitations such as events only (no TO DO, no JOURNAL, no ALARMS, etc), but it was all I needed. The output is acceptable to Lightning and Google.
    If you are computer literate I could give you the source code. You would also need Python on your computer.
    An alternative is to take the exported .ics file and use a text editor on it to delete all the old stuff -- a very tedious process!
    In either case, the overall process would be to export the calendar to an .ics file, cut out the old items, delete everything from your calendar (or just create a new calendar), and then import the cleaned up .ics file.

  • Help! All Inbox Emails older than 2-3 weeks have disappeared in Outlook 7, IMAP GoDaddy

    Hi,
    So we have two computers in the office that are set up with Outlook (email addresses are hosted on GoDaddy) in IMAP.  The computer with Outlook 7 was working fine, but a few weeks ago, we noticed that ALL emails older than a couple weeks had simply
    disappeared from the inbox!  And it keeps happening everyday.  As soon as more emails come into the Inbox, some of the oldest (again only a few weeks old) emails just vanish.
    All the archive settings are off and Auto Archive has been disabled since the beginning.  I have tried to locate a pst file that might have these emails in them but all the files I have been able to find
    are archived Sent Mail.  All Sent Mail is still available as well as any emails saved in any of the other email folders.  What is even more confusing is that all the emails have also disappeared from the Inbox on the GoDaddy server as well!  I've
    tried the repair tools, I've tried opening Outlook in safemode, and resetting the mailbox views, etc...  NOTHING has worked and the issue keeps happening, so we are losing emails daily.
    At first, we thought this might be an issue because the email had been linked to an iPhone and we were told that the Apple cloud server had a habit of erasing emails to make space on the server once it got
    full, but we disconnected the iPhone comepletely from the account and it is still happening.  What's the most confusing is why the emails aren't able to be found on our GoDaddy server, since we have unlimited space on our account.
    Anybody have this issue as well?  I really need to find these emails, being able to access ALL of our client correspondence is essential to our daily work!
    Thanks in advance!

    Hi,
    If we search the missing items in All Mail Items in Outlook, can you find them?
    We can also try to use the Inbox repair tool to scan and repair your Outlook data file to check if it helps. See:
    http://office.microsoft.com/en-in/outlook-help/repair-outlook-data-files-pst-and-ost-HA010075831.aspx
    Since your emails are disappeared from the server, please also contact your ISP to get assistance on the server side.
    Best Regards,
    Steve Fan
    TechNet Community Support

  • Export -mailbox to move emails older than 400 days to pst file

    i have written the below script
    $date = get-date
    $MailboxList = get-content "E:\del_users.txt"
    ForEach ($Mailbox in $MailboxList) {
    Export-Mailbox -Identity $Mailbox -PSTFolderPath E:\pstfiles\$mailbox.pst -BadItemLimit 1000000 -StartDate $date.adddays(-450).ToString('MM/dd/yyyy') -DeleteContent
    my target is to move all emails older than 450 days to a pst file. i ran this on one user and noticed his emails from today to 450th day from today was moved out.
    In simple terms, i want to move all emails in all sub-folders that are older than 01-January-2014. Once this is done and when he logs to owa or outlook he must be only be able to see emails from 01-Jan-2014 to 17-Mar-2015.
    how can i achieve this with the above script?
    cheers

    We are facing this error with few mailboxes which are exclusively in one DB under one Storage Group & the mailbox is on EX001 with Exchange 2007 SP1
    We have 2 exchange servers:
    EX001 - Exchange 2007 SP1
    EX002 - Exchange 2007 SP3 (fully updated)
    I have setup a Windows 8.1 32bit machine with Outlook 2013 for running the export-mailbox cmdlet to export mails to a PST file
    We are facing this error with few mailboxes which are exclusively in one DB under one Storage Group & the mailbox is on EX001 with Exchange 2007 SP1
    We I run the below script, 
    $date = get-date
    $MailboxList = get-content "E:\del_users.txt"
    ForEach ($Mailbox in $MailboxList) {
    Export-Mailbox -Identity $Mailbox -PSTFolderPath E:\pstfiles\$mailbox.pst -BadItemLimit 1000000 -StartDate “01/01/2005" -EndDate “12/31/2013" -DeleteContent
    I get the below error, only from some users and not all users.
    Error was found for User ([email protected]) because: Error occurred in the step: Moving messages. Failed to copy messages to the destination mailbox store with error: 
    MAPI or an unspecified service provider.
    error code: -1056749164
    I went through the link: https://social.technet.microsoft.com/Forums/en-US/3c75a6db-74a4-484c-a7f4-5b411900d09b/exchange-2007-exportmailbox-error-message-on-only-certain-mailbox?forum=exchangesvrdeploylegacy 
    I understand this is a permission issue and i have tried all of the below
    1. The user doing the export is a member of local administrator group in both source and target machine.
    2. the user doing the export is granted the exchange administrator role on EMC in both the source and target machine.
    3. Given full access permission to the username moving the mailbox to PST
    4. given receive-as permission to the username moving the mailbox to pst
    5. Given genericall access to the DB
    6. Create a New User account (EX: ExportAdmin)
    Add this account to a Exchange Server Administrator Permission Both Source and Target Exchange Mailbox Server
    Add this account to Local Administrators Group Member Both Source and Target Exchange Mailbox Server
    Make sure this account DO NOT HAVE ANY Domain Admin/Exterprise Admin permission(Just keep Domain User group permission)
    Assign Mailbox Full Access to this account by follow Cmdlet
    Get-Mailbox -Server "EX-CCR" | Add-MailboxPermission -User ExportAdmin -AccessRights FullAccess
    Runas with ExportAdmin account (Open EMC)
    Get-Mailbox -Server "EX-CCR" | Export-Mailbox -PSTFolderPath
    Done
    7. On the DB, we set the retention to 0
    however none of the above has helped me resolve my issue.
    Please help me correct this

  • Password protecting mail app and permanent deletion of emails so they don't appear in spotlight search

    I realise that there is a temporary way to prevent this happening by unticking the 'mail' option in the spotlight search settings menu, but how do you permanently delete the emails? I assumed that when I hit delete then emptied the trash box, the mails were gone for good. But finding that they remain stored in some hidden place and can be easily accessed is very annoying! In fact, finding that other users can quickly change the settings back and have free access to my email is rather disturbing anyway, especially as there is no way to password protect my email account once i activate the mail app. the apple mail app is linked to my yahoo account, but within yahoo mail there seems to be no problem in regards to deleted mail being stored somewhere else, only within the apple app system.
    So i guess id like to know, is there some way to password protect my account or do I just need to keep deleting my account before lending the ipad to someone else and then reinstating it? And is there any way to properly delete emails for good?
    I would be happy just to go without the mail app and log in directly through yahoo in Safari, except that I find the notification alert when I receive a new mail very handy!!

    [edit] I dragged the email I sent through the MBP Mail app (under MAILBOXES > Sent > Yahoo!) to the highlighted Sent folder (YAHOO! > Sent), and now it shows up on all Yahoo Sent folders (iPad app, web browser, phone app). Not entirely solved the issue but will use web browser to sent future emails to keep everything in sync.

  • How do I delete all email messages in just one touch (delete all feature)?

    Does anyone know how to perform a "delete all" in order to delete all email messages rather than going through each message one at a time to move from the inbox to the trash folder, then delete from the trash folder permanently?  Currently, we seem to be able to only select one message at a time, rather than perform "Delete All".
    I read in a forum post about the "Delete All" button being available only when pressing Edit in the Trash folder.  Could someone please provide the sequence of steps to successfully delete all messages in one step?  Thanks.
    John Bottiger

    It is not possible other than as described by yourself - singly to the Trash folder and then collectively from there if you so wish.

  • How does one delete all emails in iOS 8?

    Since there isn't an option to mark all for deletion, I am tired of checking or swiping each individual email to delete.  I tried the technique of marking all read, checking one email, press/hold move button while unchecking, moving what appears to be all my mail selected and watching it slide to the trash; but when I check trash to delete all from there, it's empty and all the mail is back where it was.  HELP!  Am I missing something (I am an iPhone newbie but not a techie neophyte) or did something this simple get overlooked?

    Little Gypsy wrote:
    Since there isn't an option to mark all for deletion, I am tired of checking or swiping each individual email to delete.  I tried the technique of marking all read, checking one email, press/hold move button while unchecking, moving what appears to be all my mail selected and watching it slide to the trash; but when I check trash to delete all from there, it's empty and all the mail is back where it was.  HELP!  Am I missing something (I am an iPhone newbie but not a techie neophyte) or did something this simple get overlooked?
    There is no option/settings on the iphone to delete all email message.  You would need to go to edit - then select the emails you want to delete.
    if you have an imap email account, you can do a mass delete on your computer and it will reflect on your iphone.

  • How do I permanently delete unwanted emails received on my iPad?

    How do I permanently delete unwanted emails from my iPad?

    I have tried over and over again to delete from inbox(es) followed by emptying trash in all accounts, and it doesn't work. any other suggestions?

  • How do you "delete all" email on iPhone 4S?

    How do you "delete all" email on iPhone 4S?

    There is no delete all option, unless you want to remove the email account, but I doubt that is what you are seeking.

  • How do I delete ALL emails on Droid Turbo (pop3)?

    I have a Droid Turbo, and love it. But I cannot figure out how to mass delete (all) emails from the phone. I use Pop3 to my email.
    I know you can swipe individual emails to delete or press and hold on an email to select, then do the same individually to many and then delete, but I cannot find a "delete all" option like my previous Droid Maxx. Because I haven't been able to keep up with it, I have over 999 emails sitting in there with no way at the moment to delete them all unless I spend a few hours deleting each one, one by one.
    Any help here?
    Thanks.

    That is extremely disappointing. If I delete the account from my phone, will it delete all the messages that way? I might have to find a way to delete and re-add the mail into the phone as the current amount of messages is a large bloat to the phone.
    Also, where do I suggest this "delete all" be added to the phone? This was on the Droid Maxx and previous versions. It is odd they would remove an option that could cause extreme bloat.

  • How to delete all emails in inbox on ipad

    How do I delete all emails at once in the ipad inbox

    You actually can:
    it took me weeks of research to figure out finally how to decode this yet another secretive secrets of apple. there is a perfect way of deleting ALL emails at once without jailbreaking your iphone or ipad...and here it is:
    Open Inbox>>EDIT >> check/select the top message, it will highlight the move button >>press and hold the move button and uncheck the message that you had checked earlier >> lift all your fingers off from the ipad screen and leave it alone. wait until all your messages pile up on the right hand portion of the screen (in ipad). iphone will give you the actual number of emails it has selected for the action. now they are just waiting for your command to be moved ALL at once. >> choose trash to delete all of them or any other folder where u want to move them, like one piece. remember this will replicate your action on the server so u will ACTUALLY move them or delete them on the server and not just the ipad.
    once you have moved all messages to trash you can either leave them there for the scheduled cleaning or empty it right away by doing this: go to trash folder and click edit. the delete all button shows up at the bottom of the screen. hit it! you r done!
    if you do not see effects of your actions on the server make sure you have enabled Your email accounts for such actions.
    tips:
    1. please give enough time (could take upto several minutes depending the number of emails to be moved) for the emails to be selected for the move. your screen will become unresponsive while all emails are being packaged. once emails are ready, in ipad, you will see them zoomed out on the right hand side of the screen, and in iphone you will see the message showing you the actual number of messages that have been selected.
    2. avoid purging very large number of emails, the mail app might freeze or crash. if your inbox has thousands of emails change your sync settings in mail settings to fill lesser number of emails in you inbox

  • Why is there no way to delete all emails from my iphone?

    Why is there no way to delete all emails from my iphone? IOS 7.1. Every other phone in the market allows you to 'select all' then delete.
    This trick of selecting one, then holding move, then unchecking (and subsequently moving all the emails to trash) doesn't work. I've read these suggestions and while it appears to work the emails just show up again once you leave and return to the inbox. Perhaps it worked on an older version of IOS.
    It blows my mind this is not a standard function. I get a few hundred emails at work every day, and most of the time I just want to delete all of them from the phone as I've read them already. Currently it seems i can only click edit and then have to check each email individually to be able to delete them at the same time; this is the definition of tedious. I would think there are millions of other iphone users who get their company email on their phones that must experience the same thing. It seems now i either spend 20 minutes a day deleting emails, or just let thousands of emails accumulate on the phone (taking up space and also making it hard to just review the most recent emails which is all I want to be able to do when checking email on my phone).
    I am hoping I am just missing some simple solution here that everyone else uses. Please help!!
    Mark

    Only Apple could answer as to why there is no "select all/"delete all" function in the iOS mail app. Users have been bemoaning this lack of functionality for years now. Like everyone else, you can submit feedback to. Apple here.
    Apple - iPhone - Feedback
    While I understand the whole idea of being able to use the phone on the run, if you have an IMAP email account, and if you have access to a computer at work during the day, use your "select all" function on the server and delete all of the unwanted email there and it will be removed from the phone as well.
    That doesn't solve the problem on the phone, but it gets rid of the email which is your ultimate goal anyway.

Maybe you are looking for

  • Is there a way of having 2 iPhones on one iTunes account and not share phone contacts

    Got my wife an iPhone and would like to share one iTunes account but is there a way of not sharing our contact lists, mine is full of work numbers and dont want to fill up her phone with them!! Many thanks

  • Dump error while running termination action

    I'm facing a dump error while running termination action, please, if some one wud help me out of this error. here when im termination action the system is opening action infotype when given the date of termination and try to save, system shows a warn

  • Can't get iphone to work due to zoom

    Can I disable zoom? iTunes does not recognize my phone... it asked me to respond on my phone, but the phone isn't working due to the oversized cover photo Thanks for any help!

  • MacBook resolution on 20" iMac?

    Is it possible to get a 20" iMac to run at the same display resolution as a 13" MacBook? I know the answer is yes, because you can simply run the 20" iMac at a lower resolution. However, when you do this, everything has a blurry soft look to it. So m

  • Rac DB 10.2  & Bpel/ OAS 10.1.2.0.0

    bpel installs just fine going to a non-rac dehydration db; bpel/oas v 10.1.2.0.0 to db 10.2; re-ren irca & upgrade scripts on the db; had to insert the vip hostname for the irca script's network adapter; still cannot however, get bpel past the connec