No description
Find a file
2023-08-26 15:08:29 +02:00
LICENSE Current version 2023-08-26 15:08:29 +02:00
purger.ps1 Current version 2023-08-26 15:08:29 +02:00
README.md Current version 2023-08-26 15:08:29 +02:00

Office 365 email purger

This PowerShell script will use Compliance Search to purge all content older than a specified date involving one or more specified users from all mailboxes in an Office 365 tenant.

Usage

  1. Download the script and save it to your computer.

  2. Edit the script and change the following lines to match your environment:

    $Addresses = @("user@example.com", "user2@example.com")
    $MaxDate = "2016-01-01"
    
  3. Run the script. You will be prompted for your Office 365 credentials.

  4. Get a cup of coffee, and then another. This script will take a while to run. As in, hours or days, depending on the size of your organization.

Notes

  • This script will delete all content older than the specified date, including items in the user's mailbox that were sent to or received from other users in the organization.
  • The larger your organization, the longer this script will take to run.
  • This is quite a dangerous script. Use it at your own risk.
  • This script may delete more or less than you expect.
  • The script is provided as-is. I am not responsible for any damage caused by running it.

License

This script is licensed under the MIT License.