Howto use PowerShell to search the server for all mail older than a certain date
We are preparing to implement a new retention policy and do not want email on our server older than 2 years. What would the syntax be for a PowerShell command to search across the entire server for email beyond that time frame? Is there a way for the command to output the statistics of how many email items and the total size that they take up?
November 20th, 2009 10:38am

Hi, I am afraid that there is no Powershell command that we can use to get the number and size of messages which older than a certain day. Maybe you can use Export-Mailbox command with StartDate parameter to export the messages older than a certain date. ~~~~~~~~~~~~~~~~ Mike Shen TechNet Subscriber Support in forum If you have any feedback on our support, please contact tngfb@microsoft.com ~~~~~~~~~~~~~~~~
Free Windows Admin Tool Kit Click here and download it now
November 23rd, 2009 4:23am

Hi,Export-Mailbox would be your friend here, though you will not be able to get all details, you will have to look at results and analyze.Refer: http://technet.microsoft.com/en-us/library/aa998579.aspxNitin Gupta (gupnit) | MVP - Exchange | http://www.nitingupta.in/blogs
November 23rd, 2009 4:46am

I'm actually working on this exact same project. It's been almost 2 years since anyone has posted anything on this thread. Hoping someone has found a way to get this information... I don't mind if I have do run the script per mailbox...just looking to see if I can find the number of items and total size of messages older than a specific date. Thanks.
Free Windows Admin Tool Kit Click here and download it now
July 26th, 2012 5:04pm

I've just googled around and see quite a number of requests for this functionality but it does not look like it is possible. I do find that strange since MRM can indeed find messages older than such a date and then take action. You would think, everything in Exchange being based on Powershell, that there would be a way to output the results of the query. But if you want the total size of all those messages... That would be complex. Someone suggested above that one might try Export-Mailbox - or the E2K10 SP1 and SP2 equivalents: http://technet.microsoft.com/en-us/library/ee633455.aspx But I don't think that will provide the details you want (?). Please mark as helpful if you find my contribution useful or as an answer if it does answer your question. That will encourage me - and others - to take time out to help you.
July 26th, 2012 6:24pm

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

Other recent topics Other recent topics