Video Screencast Help
Give us your opinion and win with Symantec! Please help us by taking this survey to tell us about your experience with Symantec Connect, so that we can continue to grow and improve.  Take the survey.

Need Help w a SQL Query

Created: 05 Nov 2012 • Updated: 05 Nov 2012 | 5 comments
Scott _Hastings's picture
This issue has been solved. See solution.

Can someone help me with a SQL Query that will report the last archive time for archive-enabled mailboxes?

Thanks for any help!!

Discussion Filed Under:

Comments 5 CommentsJump to latest comment

TonySterling's picture

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

SOLUTION
Scott _Hastings's picture

Tony, when I run this, I get all archives/mbx's. Can you help me get just mbxs enabled for archiving?

Scott _Hastings's picture

and I see where it says .. WHERE ex.mbxarchivingstate = 1

Seems like it should work.

Scott _Hastings's picture

Tony...  Accept my apologies. I didn't copy the whole query to SQL sad

TonySterling's picture

Cool deal, glad it is working.