Solved

Delete an email sent to all users Exchange 2007 Powershell

Posted on 2013-12-26
5
1,889 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
To show how to generate a certificate request 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 Servers >> Certificates…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

751 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