A Dtrace of StorageManagement will show the following:
(StorageManagement) <5468> EV:M StorageManagement::CArchiveFolderCleaner::DeleteEmptyFoldersReadFromDirectory - Attempting to delete folder 1234ECDD7383D62228304346EBB5CD0DF1110000EV
(StorageManagement) <5468> EV:L {CArchiveAssister::DeleteFolder} (Entry)
(StorageManagement) <5468> EV:H {CDirectoryConnectionObject::MarkFolderForDeletion2} HRXEX fn trace : Returning error [0xc004716f], [d:\builds\57\ev\v-prod-s\sources\source\directory\directoryconnection\directoryconnectionobject_1.cpp, lines {11696,11704,11711}, built Aug 15 10:14:07 2024].
(StorageManagement) <5468> EV:L {CArchiveAssister::IsOverrideMbxFolderCheck:#2884} isOverrideMbxFolderCheck : False
(StorageManagement) <5468> EV:H {CArchiveAssister::DeleteFolder} ArchiveFolder Entry ID: 1234ECDD7383D62228304346EBB5CD0DF1110000EV Force delete: False|
This issue can occur if the ExistsInMbx value is set to 1 in the ExchangeMbxArchiveFolder table. Folders can only be deleted if they contain no sub-folders with items.
Determine if ExistsInMbx is set to 1 by running the following query against the folder ID returned in the Dtrace log.
USE EnterpriseVaultDirectory
SELECT *
FROM [EnterpriseVaultDirectory].[dbo].[ExchangeMbxArchiveFolder] EF
JOIN [EnterpriseVaultDirectory].[dbo].[ArchiveFolderView] AFV on AFV.RootIdentity = EF.RootID
WHERE AFV.VaultEntryId = '1234ECDD7383D62228304346EBB5CD0DF1110000EV' -- Replace with the ID from Dtrace
If ExistsInMbx = 1, then the deletion will fail.
Add the following DWORD with a value of 1:
Name: OverrideMbxFolderCheck
Key: HKLM\SOFTWARE\Wow6432Node\KVS\Enterprise Vault\Storage
Restart the Enterprise Vault Storage Service with a Dtrace on StorageManagement to validate if the error no longer occurs and the folder is deleted.
Note: This key exists in 14.4.1, 14.5 and higher.