team_iron
asked on
powershell delete specific emails
we have exchange 2007 running and i want to create a powershell script to delete all messages from a specific mailbox where sender = "USER". it all points to export-mailbox. needs some assistance.
i also need a powershell script to delete all emails for a specific mailbox in their deleted items folder
i also need a powershell script to delete all emails for a specific mailbox in their deleted items folder
ASKER
do you need to specify a target mailbox and targetfolder?
yes you do
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
that makes sense. i will try that
I stand corrected , thanks Shaun never even thought of removing these parameters
add-mailboxpermission name@domain.com -user administrator -accessright FullAccess
then
export-mailbox name@domain.com -senderkeywords "user@domain.com" -targetmailbox "administrator" -targetfolder "whatever" -deletecontent:$true