locked
I Deleted of All the Items of Several Exchange 2007 mailboxes is there an Exchange Shell Script to Recover RRS feed

  • Question

  • I ran the shell command

    Get-Mailbox -Server colmx | Export-Mailbox -SubjectKeywords “[ ]” -DeleteContent

    trying to delete all spam that had the subject "[ ]"

    Obviously that was a mistake because it started deleting every email that had a
    space in it. I did not expect that. now I have several people asking me to
    recover their emails. I could go to each computer and each folder that had the
    contents deleted, but I am hoping someone can help me with a shell script that
    will fix it faster.

    Thanks
    Monday, November 5, 2012 4:04 PM

Answers

  • Hello Erik,

    This will use EWS Managed API, I suggest you go to ask in Exchange Development forum, maybe somebody there can help you on this issue:

    http://social.technet.microsoft.com/Forums/en-US/exchangesvrdevelopmentlegacy/threads

    There is one script to recover all deleted items in mailbox on Exchange 2010:

    PowerShell: Script to recover all deleted items in a mailbox

    http://blogs.msdn.com/b/emeamsgdev/archive/2012/04/27/powershell-script-to-recover-all-deleted-items-in-a-mailbox.aspx

    Thanks,

    Evan Liu

    TechNet Subscriber Support in forum

    If you have any feedback on our support, please contact tnmff@microsoft.com


    Evan Liu

    TechNet Community Support

    Tuesday, November 6, 2012 10:14 AM
    Moderator
  • Alternatively if the info on the above threads didn't provide much help then, one other way that you can use:

    1. as you have used -DeleteContent Switch  in conjunction with Export-Mailbox you can user Import-Mailbox with -IncludeFolders Switch Provided. ( but i know this is very hectic process as you would have chain of folders that you want to specify.

    2. 2nd option that you may try is to restore a Good Full back(which you think has all the information missing) to a Recovery Storage group and later run the command below:

    Get-MailboxStatistics  -Database “Recovery Storage Group\Mailbox Database” | Restore-Mailbox

    Bottom Line: You would need to export all the content to PST which you have in the mailbox which you specified with Export-Mailbox which you have specified on your questions!

    Hope This Helps!


    M.P.K ~ ( Exchange | 2003/2007/2010/E15(2013)) ~~ Please remember to click “Vote As Helpful" if it really helps and "Mark as Answer” if it answers your question, “Unmark as Answer” if a marked post does not actually answer your question. ~~ This Information is provided is "AS IS" and confers NO Rights!!

    Tuesday, November 6, 2012 1:51 PM

All replies

  • Hello Erik,

    This will use EWS Managed API, I suggest you go to ask in Exchange Development forum, maybe somebody there can help you on this issue:

    http://social.technet.microsoft.com/Forums/en-US/exchangesvrdevelopmentlegacy/threads

    There is one script to recover all deleted items in mailbox on Exchange 2010:

    PowerShell: Script to recover all deleted items in a mailbox

    http://blogs.msdn.com/b/emeamsgdev/archive/2012/04/27/powershell-script-to-recover-all-deleted-items-in-a-mailbox.aspx

    Thanks,

    Evan Liu

    TechNet Subscriber Support in forum

    If you have any feedback on our support, please contact tnmff@microsoft.com


    Evan Liu

    TechNet Community Support

    Tuesday, November 6, 2012 10:14 AM
    Moderator
  • Alternatively if the info on the above threads didn't provide much help then, one other way that you can use:

    1. as you have used -DeleteContent Switch  in conjunction with Export-Mailbox you can user Import-Mailbox with -IncludeFolders Switch Provided. ( but i know this is very hectic process as you would have chain of folders that you want to specify.

    2. 2nd option that you may try is to restore a Good Full back(which you think has all the information missing) to a Recovery Storage group and later run the command below:

    Get-MailboxStatistics  -Database “Recovery Storage Group\Mailbox Database” | Restore-Mailbox

    Bottom Line: You would need to export all the content to PST which you have in the mailbox which you specified with Export-Mailbox which you have specified on your questions!

    Hope This Helps!


    M.P.K ~ ( Exchange | 2003/2007/2010/E15(2013)) ~~ Please remember to click “Vote As Helpful" if it really helps and "Mark as Answer” if it answers your question, “Unmark as Answer” if a marked post does not actually answer your question. ~~ This Information is provided is "AS IS" and confers NO Rights!!

    Tuesday, November 6, 2012 1:51 PM
  • Hi Erik,

    How about the issue, any updates?

    Thanks,

    Evan Liu

    TechNet Subscriber Support in forum

    If you have any feedback on our support, please contact tnmff@microsoft.com


    Evan Liu

    TechNet Community Support

    Monday, November 12, 2012 8:20 AM
    Moderator