cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
nhouse24
Engaged Sweeper II
I am looking for a report that will detail Exchange mailbox usage but also allow it to filter out mailboxes over or under a specific size.
1 REPLY 1
nhouse24
Engaged Sweeper II
I found my own solution. This code will filter out mailbox sizes over just under 1 GB.

SELECT TOP (1000000) tblExchangeMailbox.DisplayName, tblExchangeMailbox.Alias, tblExchangeMailbox.RecipientTypeDetails, addresses.email AS EmailAddress, tblExchangeServer.AssetId AS ServerAssetId,
tblExchangeServer.Name AS ExchangeServer, tblExchangeMailboxStatistics.TotalItemSize
FROM tblExchangeMailbox LEFT OUTER JOIN
(SELECT MIN(Address) AS email, MailboxId
FROM tblExchangeMailboxAddress
GROUP BY MailboxId) AS addresses ON addresses.MailboxId = tblExchangeMailbox.MailboxId INNER JOIN
tblExchangeServer ON tblExchangeServer.ServerId = tblExchangeMailbox.ServerId INNER JOIN
tblExchangeMailboxStatistics ON tblExchangeMailbox.MailboxId = tblExchangeMailboxStatistics.MailboxId
WHERE (tblExchangeMailboxStatistics.TotalBytes > 900000000)
ORDER BY tblExchangeMailboxStatistics.TotalBytes DESC