I have the following sql script which shows assign retention categories and item counts for a particular mailbox ID.
USE EnterpriseVaultDirectory
SELECT RetentionCategoryName, RetentionCategoryIdentity
FROM RetentionCategoryEntry
USE EVVSMBXVS_1
SELECT AV.ArchiveName, RCE.RetentionCategoryName, S.RetentionCategoryIdentity, COUNT(*) AS "# of items"
FROM Saveset S
JOIN Vault V
ON S.VaultIdentity = V.VaultIdentity
JOIN EnterpriseVaultDirectory.dbo.root R
ON V.VaultID = R.VaultEntryID
JOIN EnterpriseVaultDirectory.dbo.ArchiveFolderView AFV
ON R.RootIdentity = AFV.RootIdentity
JOIN EnterpriseVaultDirectory.dbo.ArchiveView AV
ON AFV.ArchiveVEID = AV.VaultEntryId
JOIN EnterpriseVaultDirectory.dbo.RetentionCategoryEntry RCE
ON S.RetentionCategoryIdentity = RCE.RetentionCategoryIdentity
WHERE AFV.ArchiveVEID = 'XXXXXXXXXD45EC934E84D392A1D19EB8691110000EVMAILBOX' -- Get this value from the properties of the archive, Advanced tab.
GROUP BY AV.ArchiveName, RCE.RetentionCategoryName, S.RetentionCategoryIdentity
I have a few users who were put in the wrong provisioning group for a period of time and mail may have been archived and expired under a different retention catgory as planned.
If the retention category no longer has anty items since all mail has been expired. Which the assigned retention category still show even though there are no messages in the database anymore?
Thanks