Delete content from mailbox
I deleted mailbox content with this powershell command on exchange 2010 sp1:
Search-mailbox Identity <Mailbox> -SearchQuery "received:<02/15/2012" -DeleteContent
The result showing :
[PS] C:\Windows\system32>Search-mailbox -Identity Smith -SearchQuery "received:<02/15/2012" -DeleteContent
Confirm
Deleting content from mailboxes mona
[Y] Yes [A] Yes to All [N] No [L] No to All [?] Help (default is "Y"): a
RunspaceId : 9b1d043c-5302-4e47-9a8a-20c78ff8ab5e
Identity :Domain/User/Smith
TargetMailbox :
TargetPSTFile :
Success : True
TargetFolder :
ResultItemsCount : 2081
ResultItemsSize : 212.7 MB (223,013,340 bytes)
But when go to Smith outlook the messages were not deleted. Why this happened?
What needs to do some period mails delete from outlook?
Thanks!!!!
August 1st, 2012 11:37pm
You can check the link below for the correct format
Search-Mailbox -Identity Smith -SearchQuery "Received:<$('02/15/2012')" -DeleteContent
http://social.technet.microsoft.com/Forums/en-US/exchange2010/thread/6114adb8-7e65-46e0-b54f-704ad15ef723/
Free Windows Admin Tool Kit Click here and download it now
August 2nd, 2012 2:24am
You can check the link below for the correct format
Search-Mailbox -Identity Smith -SearchQuery "Received:<$('02/15/2012')" -DeleteContent
http://social.technet.microsoft.com/Forums/en-US/exchange2010/thread/6114adb8-7e65-46e0-b54f-704ad15ef723/
August 2nd, 2012 2:26am
[PS] C:\Windows\system32>Search-mailbox -Identity Smith
-SearchQuery "received:<02/15/2012" -DeleteContent
Confirm
Deleting content from mailboxes mona
[Y] Yes [A] Yes to All [N] No [L] No to All [?] Help (default is "Y"): a
RunspaceId : 9b1d043c-5302-4e47-9a8a-20c78ff8ab5e
Identity :Domain/User/Smith
Hi shrigiriraj,
Did you copy the output from EMS? I wonder the different maibox name.
Instead of deleting the content, you can also copy the search result to another mailbox(-TargetMailbox -TargetFolder) to check the result first.
Search-Mailbox
http://technet.microsoft.com/en-us/library/dd298173.aspx
Frank Wang
TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
August 3rd, 2012 2:50am
Hi shrigiriraj,
Any updates?Frank Wang
TechNet Community Support
August 6th, 2012 12:10am
I change the name of the user and domain name for my company policy.
Free Windows Admin Tool Kit Click here and download it now
August 6th, 2012 3:12pm
Hi shrigiriraj,
Yes, I understand. I just want to make sure Smith & Mona are same user object.
How about the cmdlet now? Does it work?Frank Wang
TechNet Community Support
August 6th, 2012 9:51pm