Deleting mails older than 7 years
Hi,
Guys,
My company is planning to implement a 7 yrs. retention policy for all the users.
Can someone please help me with a script that will show how much amount of data will be deleted after the policy is applied?
Thank you in advance.
Hello,
I assume you are going to expire based on the items date, not on the archived date (i.e. date of the mail, instead of date when mail was archived).
I have below query, which I used in the past. I did not write this query, so if it fails, I won't be able to help.
--
--
-- change VSDB to your VaultStoreDatabaseName
--
--
SELECT A.ArchiveName "Archive Name",
COUNT(S.IdTransaction) AS ArchivedItemCount,
SUM(S.ItemSize)/1024 "Compressed Size (MB)",
SUM(SP.OriginalSize)/1024/1024 "Uncompressed Size (MB)"
FROM EnterpriseVaultDirectory.dbo.Archive A,
EnterpriseVaultDirectory.dbo.Root R,
VSDB.dbo.ArchivePoint AP,
VSDB.dbo.Saveset S,
VSDB.dbo.SavesetProperty SP
WHERE A.RootIdentity = R.RootIdentity
AND R.VaultEntryId = AP.ArchivePointId
AND AP.ArchivePointIdentity = S.ArchivePointIdentity
AND S.SavesetIdentity = SP.SavesetIdentity
AND S.IdDateTime > DATEADD(year, -7, getDate())
GROUP BY A.ArchiveName
ORDER BY A.ArchiveName