Delete Emails after export run power shell exchange 2010
Hi Ben, The scope of Search-Mailbox include entire mailbox, including all folders like Sent Items, Deleted Dolders, etc. It is confirmed in my local test. It is the same for New-MailboxExportREquest if we do not use the parameter IncludeFolders. You may open the exported PST file in Outlook to make sure messages in Sent Items are involved. Fiona Liao TechNet Community Support
September 14th, 2012 4:29am

Thanks Fiona As you have said i can confirm after opening the PST it did include all subfolders. But for some reason even though the export process completed with no errors, it missed a huge amount of emails? I can only assume this would have been down to a corruption in the users mailbox? On the same point i ran this command after the export to try and remove the exported emails: Search-Mailbox -Identity <ExchangeAlias> -SearchQuery "-lt 01/04/2012" -DeleteContent For some reason this command ended up deleting emails that were received after this date and i have no idea why! I had to end up running a restore on the users entire mailbox. Any ideas why the above command would have done that? Thanks again for any help in advance. Ben Weinberg Prime-Networks www.prime-networks.co.uk Please post the resolution to your issue so that everyone can benefit 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.
Free Windows Admin Tool Kit Click here and download it now
September 14th, 2012 10:35am

Hi After running a MailboxExportRequest on a mailbox for all items older than a certain date, i want to now delete these same emails. I know could use this command to delete all received email, but this wont include sent items will it? Search-Mailbox -Identity {Exchange Alias} -SearchQuery 'received:<07/01/2011' -DeleteContent How would i expand that to include sent items? During writing this post, i suddently realised that my export request probably did not include Sent Items either as i used this command: New-MailboxExportRequest -Mailbox exchangealias -FilePath "\\server\Archive Emails\Username\Q1 2012 Archive.pst" -ContentFilter {(Received -lt "01/04/2012")} How would i make sure the above export includes sent items as well? Thanks for any help in advance! Ben Weinberg Prime-Networks www.prime-networks.co.uk Please post the resolution to your issue so that everyone can benefit 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.
September 15th, 2012 9:41am

Hi Ben, I do think so for the missing items. Regarding the cmdlet you mentioned, it seems like the parameter is incorrect. I researched but could not fould this kind of useage. I'd suggest you use Expire or Sent. Refer to: http://technet.microsoft.com/en-us/library/bb232132.aspx Hope it is helpful. Fiona Liao TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
September 18th, 2012 1:14am

Hi Fiona. The command for the deletion of emails did run with no errors, so the command is a true command although maybe not the right one for my situation. I i used the -received command it wouldnt include sent items. Can i run the command like this? Search-Mailbox -Identity <ExchangeAlias> -SearchQuery "-received -sent -lt 01/04/2012" -DeleteContent Would that work? Ben Weinberg Prime-Networks www.prime-networks.co.uk Please post the resolution to your issue so that everyone can benefit 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.
September 18th, 2012 5:06am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics