cancel
Showing results for 
Search instead for 
Did you mean: 

Need Help w a SQL Query

Scott__Hastings
Level 5
Partner Accredited Certified

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

 

Thanks for any help!!

Scott D Hastings Sr
1 ACCEPTED SOLUTION

Accepted Solutions

TonySterling
Moderator
Moderator
Partner    VIP    Accredited Certified

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

View solution in original post

5 REPLIES 5

TonySterling
Moderator
Moderator
Partner    VIP    Accredited Certified

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

Scott__Hastings
Level 5
Partner Accredited Certified

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

Scott D Hastings Sr

Scott__Hastings
Level 5
Partner Accredited Certified

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

 

Seems like it should work.

Scott D Hastings Sr

Scott__Hastings
Level 5
Partner Accredited Certified

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

Scott D Hastings Sr

TonySterling
Moderator
Moderator
Partner    VIP    Accredited Certified

Cool deal, glad it is working.