Exchange 2010: how to Delete a single message from All users mailboxes.
hi friends
can you please guide me how to delete a specific email message from everyone mailbox in exchange 2010.
1- how to remove a specific message from everyone mailboxes
2- how to remove only attachment from a specific emails
3- how to configure export mailbox role
thanks
greenman
July 10th, 2012 4:00am
Removing a specific message is "relatively" simple. You can use the Exchange Management Shell (PowerShell) to do this:
Search-Mailbox -Identity "<user>" -SearchQuery 'Subject:"<subject_title>"' -DeleteContent
Removing an attachment, will require a bit more work. You could do that through Exchange Web Services & PowerShell.
Here's a tutorial on how to configure someone to export mailboxes from Exchange:
http://exchangeserverpro.com/export-mailboxes-exchange-server-2010-sp1
Cheers!
Michael Van Horenbeeck
Check out my blog or find me on
twitter
Free Windows Admin Tool Kit Click here and download it now
July 10th, 2012 4:30am
Hello,
Below are some command i use to perform,
how to remove a specific message from everyone mailboxes ( Change the command accordingly)
Get-Mailbox -Server Server1 -ResultSize Unlimited | Export-Mailbox -SubjectKeywords "Friday Party" -IncludeFolders "\Inbox" -StartDate "09/07/2010" -EndDate "09/09/2010" -DeleteContent -TargetMailbox MyBackupMailbox -TargetFolder DeleteMsgs -Confirm:$false
how to configure export mailbox role
Export-Mailbox -Identity <MailboxIdParameter> -PSTFolderPath <Path_Of_PST_Folder>\<File_Name>.pst(technet.microsoft.com/en-us/library/bb266964(v=exchg.80))
July 10th, 2012 5:48am
Hello,
Below are some command i use to perform,
how to remove a specific message from everyone mailboxes ( Change the command accordingly)
Get-Mailbox -Server Server1 -ResultSize Unlimited | Export-Mailbox -SubjectKeywords "Friday Party" -IncludeFolders "\Inbox" -StartDate "09/07/2010" -EndDate "09/09/2010" -DeleteContent -TargetMailbox MyBackupMailbox -TargetFolder DeleteMsgs -Confirm:$false
how to configure export mailbox role
Export-Mailbox -Identity <MailboxIdParameter> -PSTFolderPath <Path_Of_PST_Folder>\<File_Name>.pst(technet.microsoft.com/en-us/library/bb266964(v=exchg.80))
Free Windows Admin Tool Kit Click here and download it now
July 10th, 2012 5:48am
when i run that command i get error with Export-Mailbox,,. what is export-mailbox and how to configure it and im using exchange 2010 with no SP at moment??
July 10th, 2012 7:44am
Hi,
Before running Export cmdlet, you have to do two things:
1. Add RBAC Mailbox Import Export RoleAssignment to the Admin: New-Managementroleassignment Role Mailbox Import Export User Administrator
2. Now Create a Folder , Share it
The do the export: New-MailboxExportRequest Mailbox MailboxName -FilePath
\\ServerName\PST\MailboxName.pst
Regards from www.windowsadmin.info | www.blog.windowsadmin.info
Free Windows Admin Tool Kit Click here and download it now
July 10th, 2012 12:51pm
Hi thanks for the command, however can someone please explain this command for me Get-Mailbox -Server Server1 -ResultSize Unlimited | Export-Mailbox -SubjectKeywords "Friday Party" -IncludeFolders "\Inbox" -StartDate "09/07/2010" -EndDate "09/09/2010"
-DeleteContent -TargetMailbox MyBackupMailbox -TargetFolder DeleteMsgs -Confirm:$false regards greenman
July 11th, 2012 12:12am
Hi thanks for the command, however can someone please explain this command for me Get-Mailbox -Server Server1 -ResultSize Unlimited | Export-Mailbox -SubjectKeywords "Friday Party" -IncludeFolders "\Inbox" -StartDate "09/07/2010" -EndDate "09/09/2010"
-DeleteContent -TargetMailbox MyBackupMailbox -TargetFolder DeleteMsgs -Confirm:$false regards greenman
Free Windows Admin Tool Kit Click here and download it now
July 11th, 2012 12:12am
Hi GreeMann,
The "export-mailbox" is not fit for exchange 2010, you could refer to below information about exchange 2010:
http://technet.microsoft.com/en-us/library/ff607299
1. "get-mailbox -server server1 -resultsize unlimited" means:
get the mailbox on the server1.
2. "Export-Mailbox -SubjectKeywords "Friday Party" -IncludeFolders "\Inbox" -StartDate "09/07/2010" -EndDate "09/09/2010" -DeleteContent -TargetMailbox MyBackupMailbox -TargetFolder DeleteMsgs -Confirm:$false regards greenman"
The command would export the item from the mailbox(step1 result) , and some conditions should be match.
You could refer to below
http://technet.microsoft.com/en-us/library/aa998579(v=exchg.80) to understand it.
The question 1 and 3, above gave some good suggestion.
For question 2, per my know, we could not only remove the attachment for a message.
Regards!
Gavin
TechNet Community Support
July 11th, 2012 3:23am
Hi GreeMann,
The "export-mailbox" is not fit for exchange 2010, you could refer to below information about exchange 2010:
http://technet.microsoft.com/en-us/library/ff607299
1. "get-mailbox -server server1 -resultsize unlimited" means:
get the mailbox on the server1.
2. "Export-Mailbox -SubjectKeywords "Friday Party" -IncludeFolders "\Inbox" -StartDate "09/07/2010" -EndDate "09/09/2010" -DeleteContent -TargetMailbox MyBackupMailbox -TargetFolder DeleteMsgs -Confirm:$false regards greenman"
The command would export the item from the mailbox(step1 result) , and some conditions should be match.
You could refer to below
http://technet.microsoft.com/en-us/library/aa998579(v=exchg.80) to understand it.
The question 1 and 3, above gave some good suggestion.
For question 2, per my know, we could not only remove the attachment for a message.
Regards!
Gavin
TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
July 11th, 2012 3:23am
guys,
i still receive error about the export mailbox command although i made administrator of disconvery group and also run this command "New-Managementroleassignment Role Mailbox Import Export User Administrator
i also followed this link http://careexchange.in/deleting-a-specific-email-from-entire-organization-in-exchange-2010-2/
can you give me easy example so that i can understand it bear with me im new to exchange.
thanks
greenman
July 21st, 2012 11:38pm
Hi,
Did you follow MichaelVHs advice above?
Export-Mailbox (used in RTM) or New-MailboxExportRequest (SP1/SP2) is not the command to use if you want to delete an item from all mailboxes.
...and to add to his advice just add get-mailbox first.
Example:
Get-Mailbox | Search-Mailbox -SearchQuery 'Subject:"Put something here"' -DeleteContent
See: Search-MailboxMartina Miskovic
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2012 12:30am
Hi,
Did you follow MichaelVHs advice above?
Export-Mailbox (used in RTM) or New-MailboxExportRequest (SP1/SP2) is not the command to use if you want to delete an item from all mailboxes.
...and to add to his advice just add get-mailbox first.
Example:
Get-Mailbox | Search-Mailbox -SearchQuery 'Subject:"Put something here"' -DeleteContent
See: Search-MailboxMartina Miskovic
July 22nd, 2012 12:31am
i have exchange 2010 with no service pack.
i run that command and i get this error.
PS] C:\Windows\system32>Get-Mailbox | Search-Mailbox -SearchQuery 'Subject:"Virus"' -DeleteContent
he target mailbox or .pst file path is required.
+ CategoryInfo : InvalidArgument: (:) [], ArgumentException
+ FullyQualifiedErrorId : 78642B5B
[PS] C:\Windows\system32>Get-mailbox | search-mailbox -searchquery "Subject:'Virus'" -Logonly -Targetmailbox administrator -Targetfolder Inbox
The input object cannot be bound to any parameters for the command either because the command does not take pipeline in
put or the input and its properties do not match any of the parameters that take pipeline input.
+ CategoryInfo : InvalidArgument: (Administrator:PSObject) [Search-Mailbox], ParameterBindingException
+ FullyQualifiedErrorId : InputObjectNotBound,Search-Mailbox
what could be the error?
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2012 12:47am
i have exchange 2010 with no service pack.
Well, since RTM is not supported anymore you should upgrade your server(s).
Microsoft Exchange Server 2010 Service Pack 2 (SP2
http://www.microsoft.com/en-us/download/details.aspx?id=28190Martina Miskovic
July 22nd, 2012 12:53am
i have exchange 2010 with no service pack.
Well, since RTM is not supported anymore you should upgrade your server(s).
Microsoft Exchange Server 2010 Service Pack 2 (SP2
http://www.microsoft.com/en-us/download/details.aspx?id=28190Martina Miskovic
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2012 12:54am