Wednesday, October 23, 2013

Removing a Corrupt Folder from a Mailbox in Exchange

Today a customer had a corrupt folder in their accounts mailbox called "Contractors and Payments" which they were unable to delete.  When attempting to delete the folder in Outlook, they received the following error message:

Cannot delete this folder. Right-click the folder, and then click Properties to check your permissions for this folder. See the folder owner or your administrator to change your permissions. Outlook is synchronizing local changes made to items in this folder. You cannot remove this folder until the synchronization with the server is complete.


When attempting to delete this folder using MFCMAPI using a hard delete or soft delete, the following error was experienced:

Error:
MAPI_E_INVALID_ENTRYID==0x80040107
Function IpParentFolder->DeleteFolder(IpItemEID->cb, (LPENTRYID) (IpItemEID->lpb, lpProgress ? (ULONG_PTR)m_hWnd : NULL, lpProgress, ulFlags)
File MsgStoreDIg.cpp
Line 950



The folder also could not be removed using Outlook Web App.

To remove the corrupt folder, the New-MailboxRepairRequest was executed against the accounts mailbox with the corruption types set as ProvisionedFolder, SearchFolder, AggregateCounts and FolderView.

New-MailboxRepairRequest -Mailbox accounts -CorruptionType ProvisionedFolder,SearchFolder,AggregateCounts,Folderview


As this Exchange Server is running Exchange 2010, the Get-MailboxRepairRequest command does not exist.  This command was introduced in Exchange 2013 for viewing the status of a mailbox repair task.  However in Exchange 2010 we can still view the repair request using Windows Event Viewer.

We can see here the mailbox repair request started with the corruption types specified above.


The next event log shows the repair completing successfully.

 
Next verify that the corrupt folder has been successfully removed using Outlook Web App.  It should be gone.  For it to disappear in Outlook you need to delete the local cache "OST file" or recreate the users Outlook profile.  This is because the corrupt folder is still cached on the local workstation.
 
After recreating the Outlook profile we can now see that the corrupt folder is gone for good!
 
 

5 comments:

  1. Mailbox deletion/repair using shell command is the good alternative, and I guess it helped more. But what if Admin don't have good hands on power scripting? In this case a smart move is go for Exchange 2013 mailbox repair software, e.g. http://exchange.stellarservertools.com/< With few clicks one can re-access data from corrupt mailbox.

    But also give a try to above solution!

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. I tried the demo version of the stellar exchange recovery software, it was impressive. It previews all the items from the corrupt database even in demo version.

      Worth deal if someone is looking an alternative to complex Powershell!

      Delete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Thanks Clint for sharing the detail information about this error. Just want to say that I was also facing this issue in our Exchange 2013 server and fixed with the help of this application: http://www.recover-computerdata.com/exchange-server-recovery.html

    ReplyDelete