Exchange 2010 Powershell script to archive prior year emails

Laptop running Windows 11

In the continual battle to manage user mailbox sizes here is a script which will export all the user mailboxes data for the specified date range and then removes the exported data from the mailbox.

It excludes deletion of contacts, meetings and tasks using the switch not kind:contacts not kind:meetings not kind:tasks

Create a cmd file with the command:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Practical IT tips, straight to your inbox

Microsoft 365 updates, security alerts and plain-English tech advice for small businesses, emailed when we publish a new article.

We don’t spam! Read our privacy policy for more info.