Exchange server 2007 delete user emails

First grant permission to the admin account

Add-MailboxPermission -Identity "John Doe" -User compsquareadmin -AccessRights FullAccess

Export message to pst file
Export-Mailbox -Identity "John Doe" -PSTFolderPath C:\Users\compsquareadmin\Desktop\john_doe_export.pst
Note: export to pst file require 32bit operating system

Perform the deletion

Export-Mailbox -Identity "John Doe" -StartDate "01/01/2015" -EndDate "12/31/2017" -DeleteContent"