Solved

Delete an email sent to all users Exchange 2007 Powershell

Posted on 2013-12-26
5
1,763 Views
Last Modified: 2014-01-27
I need to delete an emailsent by a disgruntled employee to all of our users. We are running Exchange 2007. How can I do this in Powershell?

Also, I know that tne Export-Mailbox is used in this task, does that command move or copy all of the users mailbox? What does this command actually do and why is it sometimes used with Get-Mailbox and sometimes it is not?

Thanks
0
Comment
Question by:wayy2be
  • 2
  • 2
5 Comments
 
LVL 14

Expert Comment

by:comfortjeanius
ID: 39740393
Export-Mailbox cmdlet to export or delete messages
; it has plenty of examples to perform this action.

White Paper: Remove Specific Messages from Exchange Server or Removing specific messages from your Exchange Server
0
 
LVL 53

Expert Comment

by:Will Szymkowski
ID: 39740871
You can use the following syntax below to accomplish this...

Get-Mailbox -ResultsSize "Unlimited" | Export-Mailbox -TargetMailbox <MailboxName> -TargetFolder <FolderName> -SubjectKeyWords "your subject here" -DeleteContent

Open in new window


You can also use the below link for different syntax as well.
http://technet.microsoft.com/en-us/library/aa998579(v=exchg.80).aspx

Will.
0
 

Author Comment

by:wayy2be
ID: 39741044
The email has an attachment and I need to filter it with the attachment name. Also what are your thoughts on the second part of the question?

<<Also, I know that tne Export-Mailbox is used in this task, does that command move or copy all of the users mailbox? What does this command actually do and why is it sometimes used with Get-Mailbox and sometimes it is not?>>
0
 
LVL 53

Accepted Solution

by:
Will Szymkowski earned 500 total points
ID: 39741101
You use the get-mailbox command in conjunction with export-mailbox when you want to search for all mailboxes. If you don't use the get-mailbox command you have to specify a specific mailbox. Also with the delete content it will actually delete the email from the specified mailboxes using the deletecontent switch. As for the attachment I do not believe there is a switch for this (I'll have to double check). You can use subject or keyword search or even from a specific sender.

Will.
0
 

Author Closing Comment

by:wayy2be
ID: 39813994
Sorry for the delay!  Thanks
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Utilizing an array to gracefully append to a list of EmailAddresses
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
In this video we show how to create an Accepted Domain in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Ac…
how to add IIS SMTP to handle application/Scanner relays into office 365.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now