Bob Alvarez
asked on
Exchange 2010 SP3 delete Sent Items folder e-mails for specific mailbox
Client requesting that all Sent Item e-mails for a specific mailbox be deleted, keeping all other e-mails intact. In researching this request there doesn't appear to be a clear answer on how to achieve this result. Note, I only want this for one mailbox not for all mailboxes.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I assigned the new role of Mailbox Import Export, added myself to Discovery Management, but, the Search-Mailbox cmdlet is not found.
Do I need to cycle any service prior to running Search-mailbox?
Do I need to cycle any service prior to running Search-mailbox?
ASKER
After restarting PowerShell it allowed me to enter the command. I was prompted to reply Y for Yes, A for yes to all, and N for no, and L fo no to all. I replied Y and after a few mins I got the error message:
The property keyword isn't supported.
+ CategoryInfo : InvalidArgument: (:) [], ParserException
+ FullyQualifiedErrorId : 35DA203C
The property keyword isn't supported.
+ CategoryInfo : InvalidArgument: (:) [], ParserException
+ FullyQualifiedErrorId : 35DA203C
Oh yeah, the permission takes effect after closing and opening the EMS. And for some cases it is even necessary to logoff and then logon. I was trying here and I can see than that Advance Query parameter is not supported for the command.
One option that I made work something similarly here was using the parameter 'from:johnsmith". However, it will delete all the messages within that mailbox that were sent by the user. But the point is that if a message was sent by the user and later moved to another folder, then it will be deleted. I do not know if it applies for your case.
Search-Mailbox johnsmith -SearchQuery "from:johnsmith" -DeleteContent
If you want to avoid the prompt asking you to confirm you can add the parameter ' -Force ' (However, it is a very dangerous command and a lot of car need to be taken with this. It is even better to save the filter somewhere, validate than that is the information that you want and then delete the information).
Delete without asking:
Search-Mailbox johnsmith -SearchQuery "from:johnsmith" -DeleteContent -Force
And in case that you have messages that were sent to a different folder, you can specify the exclusion for some folders. For example:
One option that I made work something similarly here was using the parameter 'from:johnsmith". However, it will delete all the messages within that mailbox that were sent by the user. But the point is that if a message was sent by the user and later moved to another folder, then it will be deleted. I do not know if it applies for your case.
Search-Mailbox johnsmith -SearchQuery "from:johnsmith" -DeleteContent
If you want to avoid the prompt asking you to confirm you can add the parameter ' -Force ' (However, it is a very dangerous command and a lot of car need to be taken with this. It is even better to save the filter somewhere, validate than that is the information that you want and then delete the information).
Delete without asking:
Search-Mailbox johnsmith -SearchQuery "from:johnsmith" -DeleteContent -Force
And in case that you have messages that were sent to a different folder, you can specify the exclusion for some folders. For example:
Remember, if you remove it via PS, there is no roll back or recovery point. You should always use target mailbox with search mailbox cmdlet.
ASKER
Used Outlook as suggested, other ideas..while good.... did not allow for the delete.
1. Assign permissions to the account that will execute the action
Make 'Admin01' a member of the 'Discovery Management' security group in Active Directory.
New-Managementroleassignme
2. Delete the content
Search-Mailbox johnsmith –searchquery “Foldername:’SentItems’” -DeleteContent