Deleting A single e-mail from all e-mail accounts in Exchange 2013 via EMC
-
@wirestyle22 said in Deleting A single e-mail from all e-mail accounts in exchange 2013 via EMC:
Found this:
Search-Mailbox -Identity "April Stewart" -SearchQuery 'Subject:"Your bank statement"' -TargetMailbox administrator -TargetFolder "SearchAndDeleteLog" -LogOnly -LogLevel Full
but I want it to apply to all mailboxes. Simultaneously searching, but figured I should ask here as well.
For all users
Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery 'Subject:"Your bank statement"' –DeleteContent
For Search Results
Get-mailbox | search-mailbox –searchquery “Subject:’Your bank statement’” –Logonly –Targetmailbox administrator –Targetfolder Inbox
-
Someone sent a bank statement to the everyone group?
We found HR documents with people's Social Security numbers in a document everyone has read access to at a place yesterday. Wasn't caught because whoever put the document together used a screenshot, but didn't take an extra 10 seconds to black out that one section. Great times.
-
@travisdh1 No it's an example
-
hmm
-
@wirestyle22 said in Deleting A single e-mail from all e-mail accounts in exchange 2013 via EMC:
hmm
Do you have the MailboxImportExport Role assigned to your user?
-
@dbeato said in Deleting A single e-mail from all e-mail accounts in exchange 2013 via EMC:
@wirestyle22 said in Deleting A single e-mail from all e-mail accounts in exchange 2013 via EMC:
hmm
Do you have the MailboxImportExport Role assigned to your user?
Unsure what we have setup here. Haven't played with exchange yet
-
@wirestyle22 said in Deleting A single e-mail from all e-mail accounts in exchange 2013 via EMC:
@dbeato said in Deleting A single e-mail from all e-mail accounts in exchange 2013 via EMC:
@wirestyle22 said in Deleting A single e-mail from all e-mail accounts in exchange 2013 via EMC:
hmm
Do you have the MailboxImportExport Role assigned to your user?
Unsure what we have setup here. Haven't played with exchange yet
Add your user to the group
New-ManagementRoleAssignment –Role "Mailbox Import Export" –User "username"
Then Close the Exchange EMC and then open it again and run the search.
-
What about wildcards @dbeato?
Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery 'Subject:"Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery 'Subject:"Random characters* other stuff"' –DeleteContent"' –DeleteContent
-
@wirestyle22 said in Deleting A single e-mail from all e-mail accounts in Exchange 2013 via EMC:
What about wildcards @dbeato?
Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery 'Subject:"Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery 'Subject:"Random characters* other stuff"' –DeleteContent"' –DeleteContent
It should work.
-
@dbeato said in Deleting A single e-mail from all e-mail accounts in Exchange 2013 via EMC:
'Subject:"Random characters* other stuff"'
so this?
'Subject:"*other stuff"'
-
@wirestyle22 said in Deleting A single e-mail from all e-mail accounts in Exchange 2013 via EMC:
@dbeato said in Deleting A single e-mail from all e-mail accounts in Exchange 2013 via EMC:
'Subject:"Random characters* other stuff"'
so this?
'Subject:"*other stuff"'
Correct. DO a search first and see the results and then proceed to deletion.