Exchange Powershell Exchange and Powershell Helps, Tips, and Tricks

Delete all messages after date from mailbox

11.24.2009 · Posted in Exchange, Powershell

I was asked to delete everything from a mailbox called familydomains that was older than 2009. Here is the Exchange Powershell command that I used to delete everything earlier than 12/31/2008 to a PST file located in my C:\temp directory.

export-mailbox familydomains -PSTFolderPath C:\temp\ -DeleteContent -endDate 12/31/2008

The advantage to doing it this way is that no emails are actually deleted. They are moved from the mailbox to the PST file, so they can be imported, or viewed through Outlook at a later date if the end user changes their mind.

Leave a Reply