Solved

Delete an email sent to all users Exchange 2007 Powershell

Posted on 2013-12-26
5
1,799 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
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…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager

778 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