locked
Exchange Shell to export mailbox sizes RRS feed

  • Question

  • Hello All,

    I've been experiencing some trouble getting all of my mailbox users and sizes in GB's exported in an excel format. I've tried running this below but then I have to do it for each database and put it together in one excel file and it can't be sorted by GB because I will get the total size in bytes  EX:  265.7 MB (278,631,772 bytes)

    Get-MailboxStatistics  -Database “MDB03” | Select DisplayName, LastLoggedOnUserAccount, ItemCount, TotalItemSize, LastLogonTime, LastLogoffTime | Sort-Object TotalItemSize -Descending | Export-CSV c:\mailboxsize\mailboxsize3.csv

    Is there a better script that will export all mailboxes from all databases so I can sort it neatly?

    Thanks,

    Thursday, June 25, 2015 5:33 PM

Answers

  • How about

    Get-MailboxDatabase | Get-MailboxStatistics | Select DisplayName, LastLoggedOnUserAccount, ItemCount, TotalItemSize, LastLogonTime, LastLogoffTime | Sort-Object TotalItemSize  -Descending | Export-CSV c:\mailboxsize\mailboxsize3.csv


    OWA For SmartPhone

    • Marked as answer by CRMNoon Friday, June 26, 2015 12:08 PM
    Friday, June 26, 2015 9:14 AM

All replies

  • How about

    Get-MailboxDatabase | Get-MailboxStatistics | Select DisplayName, LastLoggedOnUserAccount, ItemCount, TotalItemSize, LastLogonTime, LastLogoffTime | Sort-Object TotalItemSize  -Descending | Export-CSV c:\mailboxsize\mailboxsize3.csv


    OWA For SmartPhone

    • Marked as answer by CRMNoon Friday, June 26, 2015 12:08 PM
    Friday, June 26, 2015 9:14 AM
  • Yes that will work.

    Thanks!

    Friday, June 26, 2015 12:08 PM
  • Thanks for this.

    If i wanted the OU this user object is located in as well, how can this be done?

    Thxs Chris

    Tuesday, August 29, 2017 4:52 AM