mfcmapi icon indicating copy to clipboard operation
mfcmapi copied to clipboard

MFCMAPI Hangs on Folder Clean up

Open YuriySamorodov opened this issue 2 years ago • 1 comments

When trying to clean up a fairly large folder (1.85GB, 25783 messages) MFCMAPI hangs, then throws an error:

Warning: 
Code: MAPI_W_PARTIAL_COMPLETION == 0x00040680 
Function lpMAPIFolderToEmpty->EmptyFolder( lpProgress ? reinterpret_cast<ULONG_PTR>(m_hWnd) : NULL, lpProgress, ulFlags) 
File D:\a\1\s\UI\Dialogs\HierarchyTable\MsgStoreDlg.cpp 
Line 719

image

Please kindly advise.

YuriySamorodov avatar Feb 17 '22 15:02 YuriySamorodov

Hi everyone,

i got the exact same problem deleting a large Folder > 100k Items over 100GB. Anyone's got a fix for that?

Kind Regards

Kedakai avatar Mar 10 '22 11:03 Kedakai

@YuriySamorodov Did you solve the issue? Having the same exact problem.

glebanya-git avatar Sep 30 '22 14:09 glebanya-git

@glebanya-git , nope. =(

YuriySamorodov avatar Sep 30 '22 14:09 YuriySamorodov

@glebanya-git , i wasn't able to fix it with anything. Ended up using this absolutely horrible way to delete the Mails from "Recoverable Items" in my case.

https://learn.microsoft.com/en-us/exchange/security-and-compliance/recoverable-items-folder/clean-up-deleted-items Maybe it helps you figuring out an alternative

Kedakai avatar Sep 30 '22 15:09 Kedakai

Go to your EAC Exchange admin center --> Open users mailbox settings --> Click Mailbox Tab --> Manage Mailbox Policies -->Set Retention policy to [No Policy].

Then open a second powershell. different from the one you are running the Get-MailboxFolderStatistics command from. #Connects you to exchange online (You must be a global admin) Copy and paste below: Connect-ExchangeOnline

#Loop Folder Assistant Until Data is cleared. Copy and paste below and let it run side-by-side mfcmapi: while($true) { Start-ManagedFolderAssistant -Identity username -holdcleanup write-host "waiting"; start-sleep -seconds 30; }

Be sure to connect Outlook to the account you want to clean and turn off cache mode, then close and reopen outlook so it takes effect. Close Outlook.

After doing the above, the error in this topic went away, and I could see the mailbox reduce size.

Snoopy5000 avatar May 04 '23 17:05 Snoopy5000

Hi Tarnold000,

how to stop the loop?

thanks

old7ada avatar May 08 '23 02:05 old7ada

Hi Tarnold000,

how to stop the loop?

thanks

Closing the powershell will stop the loop.

Snoopy5000 avatar May 08 '23 17:05 Snoopy5000