Deleting mailbox contents based on date RRS feed

  • General discussion

  • We have to purge data older that 12 years from about 750 mailboxes, search-mailbox won't work due to the 10000 item limitation. Does anybody know how can I achieve this, I also need to use an input file to provide mailbox (alias)name. I would like to first run it in a -EstimateOnly-like mode to see how much data will be delete, before doing the actual purge.  I'm not experience with powershell, so any assistance is greatly appreciated.

    • Edited by Fred Laidman Wednesday, May 30, 2018 8:37 PM
    • Changed type Bill_Stewart Friday, July 27, 2018 9:14 PM
    • Moved by Bill_Stewart Friday, July 27, 2018 9:14 PM This is not "scripts on demand"
    Wednesday, May 30, 2018 8:37 PM

All replies

  • Unfortunately this is not the place to ask others to write a script for you. You may have missed the first post from right at the top of this forum:

    This forum is for scripting questions rather than script requests

    -- Bill Stewart [Bill_Stewart]

    Wednesday, May 30, 2018 8:47 PM
  • This is the script I'm trying without much luck:

    Search-Mailbox -identity username -searchquery {(Received:> 01/01/1990 and Received:< 12/31/2014)} -EstimateResultOnly

    I'm hoping is a minor syntax issue, but can't figure it out.

    Ed M.

    Thursday, May 31, 2018 1:32 PM
  • A forum is just about the most inefficient way to learn how to write PowerShell commands. Guesswork is only going to slow you down and cause frustration.

    Strings need to be enclosed in quotes in PowerShell commands.

    You really need to start with the basics. We recommend the Learn link at the top of this forum for a starting point. Also, you can search for examples. Experiment. Learn. We've all been there. You have to start somewhere.

    -- Bill Stewart [Bill_Stewart]

    Thursday, May 31, 2018 2:48 PM