Link to home
Create AccountLog in
Avatar of hyperbyte
hyperbyteFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Exchange 2007 Powershell to Export Total Size of Inbox

Hello, can someone please give me a script that I can copy and paste into EMS that will give me the totalsize of the inbox of all users in my exchange in MB and export to a csv file.  Its just the size of the inbox folder I am after, not the total users mailbox size, just the inbox.

Thank you
Avatar of Vijaya Babu Sekar
Vijaya Babu Sekar
Flag of India image

check this.

displays powershell:

Get-MailboxStatistics | Sort-Object TotalItemSize –Descending | ft DisplayName,TotalItemSize,ItemCount

as CSV file:

Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | Select-Object DisplayName,TotalItemSize  | Export-CSV mailboxes.csv


Top 100 Mailboxes:

Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | Select-Object DisplayName,TotalItemSize -First 100 | Export-CSV top100mailboxes.csv
ASKER CERTIFIED SOLUTION
Avatar of Haresh Nikumbh
Haresh Nikumbh
Flag of India image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of hyperbyte

ASKER

Thanks, but I need it to take the inbox only, not the total size.  Its also not outputting it in MB?
this will give you the output in mb. MailboxFolderStatistics only works with 2010.

Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | ft DisplayName,@{label="TotalItemSize(MB)";expression={$_.TotalItemSize.Value.ToMB()}},ItemCount
Thanks takecoffee, exactly what I was after.