mfcmapi
mfcmapi copied to clipboard
MFCMAPI Hangs on Folder Clean up
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
Please kindly advise.
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
@YuriySamorodov Did you solve the issue? Having the same exact problem.
@glebanya-git , nope. =(
@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
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.
Hi Tarnold000,
how to stop the loop?
thanks
Hi Tarnold000,
how to stop the loop?
thanks
Closing the powershell will stop the loop.