Solved

Delete an email sent to all users Exchange 2007 Powershell

Posted on 2013-12-26
5
1,735 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Sorry for the delay!  Thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
In this video we show how to create a Contact 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 Recipients >> Contact ta…
In this video we show how to create an Address List 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 Organization >> Ad…

771 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