pramod1
asked on
exchange, outlook
I ran one script yesterday to delete emails with particular subject name from a particular database , it did run
Get-Mailbox -Database " Mailbox Database"| Export-Mailbox -SenderKeywords "re:expense report" -DeleteContent
but few users had this event 1008 REPORTED on exchange 2007 application logs
export-mail box task for mailbox " user name)
error: failed to copy messages to the destination mailbox store with error:
MAPI or inspecified service provider
ID no: 00000000-0000-00000000
Get-Mailbox -Database " Mailbox Database"| Export-Mailbox -SenderKeywords "re:expense report" -DeleteContent
but few users had this event 1008 REPORTED on exchange 2007 application logs
export-mail box task for mailbox " user name)
error: failed to copy messages to the destination mailbox store with error:
MAPI or inspecified service provider
ID no: 00000000-0000-00000000
ASKER
I am using exchange 2007, how should I disable content destination
or do I need to modify below one
Get-Mailbox -Database " Mailbox Database"| Export-Mailbox -SenderKeywords "re:expense report" -DeleteContent
or do I need to modify below one
Get-Mailbox -Database " Mailbox Database"| Export-Mailbox -SenderKeywords "re:expense report" -DeleteContent
You can use without setting up destination and delete directly from the mailbox. But remember this, the mobile devices are faster than outlook receiving mails. When you are removing, it should be instant, but chances are high that user receives in mobile device.
ASKER
that is fine ganesh, what command should I run on exchange 2007 now.
can you modify below:
Get-Mailbox -Database " Mailbox Database"| Export-Mailbox -SenderKeywords "re:expense report" -DeleteContent
can you modify below:
Get-Mailbox -Database " Mailbox Database"| Export-Mailbox -SenderKeywords "re:expense report" -DeleteContent
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
but can it run on exchange 2007
Yes it will run
To Remove specific mail from server for all users.
C:\>Get-Mailboxdatabase
Note all the databases homed on which server
Set permissions for all mailboxes to remove message:
[PS] C:\>Get-mailbox -Database DBName| add-mailboxpermission -user adminuseraccount -AccessRights FullAccess
You need search-mailbox cmdlet from below snapin
[PS] C:\>Add-PSSnapin Microsoft.Exchange.Managem
Remove the mail using subject and sender can include date and time as well
[PS] C:\>Get-Mailbox -Server "servername" | Search-Mailbox -SearchQuery 'Subject:"Christmas Party" AND From:circular@domain.com' –DeleteContent
If you have enabled copy content destination and tried you might have got the error for the mailbox which you did not have permission.