What:
Microsoft Windows 2008R2 with Exchange 2010 SP1
Problem:
You have been asked to delete message with subject "Confidential" from all mailboxes in the organization.
Solution:
1. Assign your account the "Mailbox Import Export RBAC" role.
Start "Exchange Management Shell" and use below command:
New-ManagementRoleAssignment -Role "Mailbox Import Export" -User administrator2. Close and Reopen "Exchange Mangement Shell" to apply changes.
3. Create report before deleting actual data.
Summary report send to administrator's mailbox
Get-mailbox | Search-Mailbox –SearchQuery "Subject:'Confidential'" –Logonly –Targetmailbox administrator –Targetfolder InboxYou can also use additional switches like:
-DoNotIncludeArchiveYou can also export report to a csv file:
-SearchDumpster:$false
-LogLevel Full
Get-Mailbox | Search-Mailbox -SearchQuery "Subject:'Confidential'" -EstimateResultOnly | Export-CSV C:\email-report.csv -NoType4. Now delete all emails
Get-mailbox | Search-Mailbox –SearchQuery "Subject:'Confidential'" –DeleteContent
Source: 1 2 3 4
No comments:
Post a Comment