SQL-Query listing ArchiveName, ArchivedItems, ArchivedItemsSize for users in certain OU
Hi,
Since I'm not a genius with the SQL querys I'm asking your help.
I need a query that lists ArchiveName, ArchivedItems, ArchivedItemsSize for users in certain OU.
There are 3 Vaultdatabases that this query has to take in to count.
I have no idea how to put this query together, please help.
Sani B.
hey sani, give this a shot. you need to replace <VaultStoreDB> with the name of your vault store database and <OU> with the name of the OU you're filtering on.
SELECT A.ArchiveName,
COUNT(S.ItemSize) "Item Count",
SUM(S.ItemSize)/1024 "Total Size (MB)"
FROM <VaultStoreDB>.dbo.Saveset S,
<VaultStoreDB>.dbo.ArchivePoint AP,
EnterpriseVaultDirectory.dbo.Root R,
EnterpriseVaultDirectory.dbo.Archive A,
EnterpriseVaultDirectory.dbo.ExchangeMailboxEntry E
WHERE S.ArchivePointIdentity = AP.ArchivePointIdentity
AND AP.ArchivePointId = R.VaultEntryId
AND R.RootIdentity = A.RootIdentity
AND AP.ArchivePointId = E.DefaultVaultId
AND E.ADMbxDN like '%<OU>%'
GROUP BY A.ArchiveName
ORDER BY A.ArchiveName