locked
Can I export user mailbox sizes to csv? RRS feed

  • Question

  • Hello,

    Can I export all our users mailbox current sizes and what their limit is?

    I did run this:

    Get-MailboxStatistics -server Exchange123 | Sort-Object To talItemSize -Descending | ft DisplayName,@ label="TotalItemSize(MB)";expression={$_.TotalItemSize.Value.ToMB() }},ItemCount >> c:\text12345.txt

    But can it show their what the maximum mailbox size can grow to?

     

    Thanks 


    • Edited by Whiteford Wednesday, October 19, 2011 5:33 PM
    Wednesday, October 19, 2011 5:13 PM

Answers

  • OK done :)

     

    I have tested in my lab below script, this should work J

    get-mailbox -ResultSize unlimited | select-object DisplayName, IssueWarningQuota, ProhibitSendQuota, @{label="TotalItemSize(MB)";expression={(get-mailboxstatistics $_).TotalItemSize.Value.ToMB()}}, @{label="ItemCount";expression={(get-mailboxstatistics $_).ItemCount}}, Database | Export-Csv "UserMailboxSizes.csv" –NoTypeInformation

    Regards 


    Chinthaka Shameera | MCITP: EA | MCSE: M | http://howtoexchange.wordpress.com/
    • Proposed as answer by Chinthaka Shameera Saturday, October 22, 2011 5:01 AM
    • Marked as answer by Terence Yu Friday, October 28, 2011 10:03 AM
    Wednesday, October 19, 2011 6:39 PM

All replies

  • Hello

    I have tested in my lab below script, this should work J

    Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Select-Object DisplayName, @{name="TotalItemSize(MB)";expression={$_.TotalItemSize.Value.ToMB()}}, ItemCount | Export-Csv "UserMailboxSizes.csv" -NoTypeInformation

    Regards


    Chinthaka Shameera | MCITP: EA | MCSE: M | http://howtoexchange.wordpress.com/
    Wednesday, October 19, 2011 5:31 PM
  • Probably. 

     

     Exactly how will depend on what version of Exchange you're running.


    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
    Wednesday, October 19, 2011 5:32 PM
  • Hello

    I have tested in my lab below script, this should work J

    Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Select-Object DisplayName, @{name="TotalItemSize(MB)";expression={$_.TotalItemSize.Value.ToMB()}}, ItemCount | Export-Csv "UserMailboxSizes.csv" -NoTypeInformation

    Regards


    Chinthaka Shameera | MCITP: EA | MCSE: M | http://howtoexchange.wordpress.com/

    Above my Cmdlet will work with Exchange 2010 and Exchange 2007
    Chinthaka Shameera | MCITP: EA | MCSE: M | http://howtoexchange.wordpress.com/
    Wednesday, October 19, 2011 5:33 PM
  • Sorry guys I missed the most important part off.  We use Exchange 2007 SP3 Rollup 4.
    Wednesday, October 19, 2011 5:40 PM
  • My script seems to do the same as yours, anyway I can add what the mailbox limit is, so it will show current size and it's limit that it acn go up to?
    Wednesday, October 19, 2011 5:45 PM
  • OK done :)

     

    I have tested in my lab below script, this should work J

    get-mailbox -ResultSize unlimited | select-object DisplayName, IssueWarningQuota, ProhibitSendQuota, @{label="TotalItemSize(MB)";expression={(get-mailboxstatistics $_).TotalItemSize.Value.ToMB()}}, @{label="ItemCount";expression={(get-mailboxstatistics $_).ItemCount}}, Database | Export-Csv "UserMailboxSizes.csv" –NoTypeInformation

    Regards 


    Chinthaka Shameera | MCITP: EA | MCSE: M | http://howtoexchange.wordpress.com/
    • Proposed as answer by Chinthaka Shameera Saturday, October 22, 2011 5:01 AM
    • Marked as answer by Terence Yu Friday, October 28, 2011 10:03 AM
    Wednesday, October 19, 2011 6:39 PM