11-05-2012 07:38 AM
Can someone help me with a SQL Query that will report the last archive time for archive-enabled mailboxes?
Thanks for any help!!
Solved! Go to Solution.
11-05-2012 08:31 AM
This should do it, runs against the vault store db:
SELECT ex.MbxDisplayName,a.archiveditems as Count, max(s.archiveddate) as LastArchived
FROM Saveset s
Join Archivepoint a on a.ArchivePointIdentity =s.ArchivePointIdentity
Join EnterpriseVaultDirectory.dbo.ExchangeMailboxEntry ex on ex.DefaultVaultID = a.ArchivePointID
WHERE ex.mbxarchivingstate = 1
GROUP BY ex.MbxDisplayName, a.archiveditems, a.archiveditemssize
11-05-2012 08:31 AM
This should do it, runs against the vault store db:
SELECT ex.MbxDisplayName,a.archiveditems as Count, max(s.archiveddate) as LastArchived
FROM Saveset s
Join Archivepoint a on a.ArchivePointIdentity =s.ArchivePointIdentity
Join EnterpriseVaultDirectory.dbo.ExchangeMailboxEntry ex on ex.DefaultVaultID = a.ArchivePointID
WHERE ex.mbxarchivingstate = 1
GROUP BY ex.MbxDisplayName, a.archiveditems, a.archiveditemssize
11-05-2012 08:51 AM
Tony, when I run this, I get all archives/mbx's. Can you help me get just mbxs enabled for archiving?
11-05-2012 08:56 AM
and I see where it says .. WHERE ex.mbxarchivingstate = 1
Seems like it should work.
11-05-2012 09:06 AM
Tony... Accept my apologies. I didn't copy the whole query to SQL
11-05-2012 10:27 AM
Cool deal, glad it is working.