Recovering folders and items from Exchange using MFCMapi
We had a user contact us yesterday who had deleted a public folder that contained a large number of subfolders and items. This is not usually too much of a drama, we have a 14 day deleted items retention period on our public folder stores, so its usually just a case of adding the DumpsterAlwaysOn key to the registry on the client, browsing to the parent public folder, clicking on Tools, then Recover Deleted Items and selecting the folder to recover. This time however, we received the following message when attempting to recover the folder:
“Outlook was unable to recover some or all of the items in this folder. Make sure you have the required permissions to recover items in this folder, and try again. If the problem persists, contact your administrator.”
Naturally, we checked the permissions; in fact we tried to use the Exchange service account mailbox to recover the folder but received the same error. We also tried temporarily disabling Trend ScanMail (our Exchange level antivirus) in case it was interfering with the recovery process. The folder would actually appear in Outlook temporailly before it produced the error, at which point it would disappear again.
We did a lot of searching around to find a solution; most forums and articles that we came across either suggested to check permissions and disable the antivirus like we had done or use isinteg to repair the database (which I’m not such a fan of). Others suggested that it wasn’t possible to recover the folder at all. After some more searching I came across a tool called MFCMapi.
Once I downloaded MFCMapi, I was able to browse the folders that had been deleted. I tried to recover the folder that the user had deleted, but it produced an error. However, because I was able to browse the sub folders, I attempted to recover one of the them and it was successful. I tried several folders, some were successful and others were not. I figured if we could get some of the contents back it would be better than nothing. It appeared that some of the contents were corrupted, which would explain was why Outlook was unable to recover the folder. Outlook doesn’t provide the option to recover the sub folders, and this is where MFCMapi really helped. I was able to restore the majority of sub folders with 5 or 6 of them not wanting co-operate.
You can download MFCMapi from here.
Once downloaded and extracted, run MFCMapi.exe and close the welcome window. To browse deleted public folders do the following:
1. Click on the Session menu and click on Logon and Display Store tables. You’ll see that it uses Outlook to connect to the stores, select your Outlook profile and click on OK
2. Click on the MDB menu and select Open Public Folder store. Tick the Use Admin Privilegesbox and click on OK.
3. Expand Public Root and IPM_SUBTREE. You’ll then see the public folders that you would normally see under “All Public Folders” in Outlook.
4. Navigate through the public folder tree until you get to the parent folder of the folder that you are trying to restore.
5. Right click on the parent folder and select Open Deleted Sub Folder Table. A new window will open displaying the deleted subfolders. Right click on the folder and select Restore Deleted Folder. A box will open up that allows you to select to also restore the subfolders, tick that option and click on OK. You may receive an error message stating that the folder couldn’t be restored, much like I did.
If you don’t receive the message then the restore was successful and you should see the public folder and items appear in Outlook. If not, don’t panic just yet, you may be able to restore some (hopefully most) of the subfolders. If this is the case, just navigate through the folder structure and attempt to restore each folder. Unfortunately it doesn’t allow you to select multiple folders using CTRL or SHIFT; I spent a fair bit of time restoring each folder one by one.
Considering that I was able to restore most of the folders and items that had been deleted, I was happy with the result, and so was the user. MFCMapi proved to be a very useful tool and I’m sure there will be times when I’ll need to use it again.
davidvogt said,
February 4, 2007 @ 2:01 pm
Your article is very informative and helped me further.
Thanks, David
Ben Christian said,
February 4, 2007 @ 8:47 pm
Cheers David, your feedback is much appreciated.
Gomathi said,
April 7, 2007 @ 6:22 pm
Hi Ben,
I hard deleted one of my sub folders under my Inbox, unknowingly. Intially I tried to use “Recover Deleted Items” option under “Tools” menu after selecting my Inbox. But I could not locate my hard deleted sub folder. I tried this one many times before looking for help in any forums. While looking for help, I found your artcile was what exactly I was looking for. I followed the Instructions, but MFCMapi came up with an error message and could not restore my hard deleted sub folder. I tried again and again many times. I tried different ways like trying to store the messages of hard deleted sub folder and so on. But I was not sucessful. Then finally I gave up. After that when I tried to read messages in my Outlook, it didn’t display the messages and forced me to re start Outlook. Once I restarted Outlook, just to try again, I selected my Inbox folder and selected “Recover Deleted Items” option from “Tools” menu. To my surprise, my hard deleted subfolder was sitting top in that list. I selected the subfolder and clicked on “Recover Selected Items”. It recovered all the messages with the Sub folder. I feel probably MFCMapi helped me in recovering these messages, but I am not sure how it happened.
Your article was really useful and am happy that it solved my problem.
Thanks,
Gomathi.
Ben Christian said,
April 8, 2007 @ 10:49 am
Thanks Gomathi. I’m not sure what resolved your issue in the end, but I’m glad that I my post was able to help out.
Carlo said,
February 6, 2008 @ 11:05 am
I had the same issue as Gomathi. I followed the steps above and it was the “DumpsterAlwaysOn” registry fix that restored my deleted subfolder.
Thanks
C
Andrew Haigh said,
February 8, 2008 @ 12:58 am
Will a hard delete of a deleted public folder via MfcMapi also remove the tombstones? I have to clear a number of deleted folders before I can kick of inter-org PF replication again and am wondering if this will speed the process up (I have enabled the Replication Folder Tombstone Limit and set it to 1 day to speed up their decay) but I am wondering if this can be sped up via MfcMapi
Cheers
Andrew Haigh said,
February 8, 2008 @ 1:56 am
Actually - I think I can answer this myself - did atest hard delete of a deleted folder from the deleted folders table and then went into PFDAVADMIN - focussed on the public store that I am currrrently working on, clicked ’show deleted folders’ and the folder I did a hard delete on is no longer in the list.
Yes, it’s a tad tedious working my way through a few hundred folders - but it’s better than waiting for the system to remove them itself
Only thing left to try is the inter-org rep to see if it’s going to complain about fodlers marked as deleted - it shouldn’t as pfdavadmin and mfcmapi can no longer see the folders in question.
it looks like this might be a good way of getting around the tombstone nonsense
-=A=-
gilbertmana said,
May 17, 2008 @ 8:53 am
Intern program for more details check out…
[url=http://www.onlinebusinessinternprogram.com/] Intern Program[/url]