locked
Delete content from mailbox RRS feed

  • Question

  • 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!!!!

    Thursday, August 2, 2012 3:29 AM

Answers

All replies

  • 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/

    • Marked as answer by emma.yoyo Friday, August 10, 2012 2:44 AM
    Thursday, August 2, 2012 6:24 AM
  • [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

    Friday, August 3, 2012 6:48 AM
  • Hi shrigiriraj,

    Any updates?


    Frank Wang

    TechNet Community Support

    Monday, August 6, 2012 4:07 AM
  • I change the name of the user and domain name for my company policy.
    Monday, August 6, 2012 7:12 PM
  • 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

    Tuesday, August 7, 2012 1:51 AM
  • Hi shrigiriraj,

    Any updates?


    Frank Wang

    TechNet Community Support

    Thursday, August 9, 2012 1:37 AM