Get Office 365 Shared Mailbox Sizes from Office 365

Office 365 gives you the ability to create shared mailboxes without having to assign a licence to them. However they need to remain under 10GB to stay free.  This script exports the size of all these mailboxes to CSV.

 
 
 
 
 
4 Star
(1)
4,542 times
Add to favorites
Office 365
1/18/2014
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • run this using MFA?
    1 Posts | Last post July 17, 2018
    • Removing the login credentials does not seem to want to run while using powershell exchange with MFA. Is there a step i am missing?
  • Errors when running
    1 Posts | Last post May 25, 2015
    • Just tried this and I'm getting the following
      
      Exception calling "Substring" with "2" argument(s): "Length cannot be less than zero.
      Parameter name: length"
      At C:\Get-SharedMailboxSizes.ps1:62 char:3
      +         $strMailboxIssueWarningQuota = "{0:N2}" -f ($ItemSizeString.SubString(($ItemSi ...
      +    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
          + FullyQualifiedErrorId : ArgumentOutOfRangeException
       
      Exception calling "Substring" with "2" argument(s): "Length cannot be less than zero.
      Parameter name: length"
      At C:\Users\sytriffett\Desktop\Get-SharedMailboxSizes.ps1:64 char:3
      +         $strMailboxProhibitSendQuota = "{0:N2}" -f ($ItemSizeString.SubString(($ItemSi ...
      +    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
          + FullyQualifiedErrorId : ArgumentOutOfRangeException
       
      Exception calling "Substring" with "2" argument(s): "Length cannot be less than zero.
      Parameter name: length"
      At C:\Get-SharedMailboxSizes.ps1:66 char:3
      +         $strMailboxProhibitSendReceiveQuota = "{0:N2}" -f ($ItemSizeString.SubString(( ...
      +    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      
      and so on
  • Appending the date to the output file
    2 Posts | Last post July 03, 2013
    • Alan, 
      Thank you for the script! It's perfect for what I need. Would it be possible to have the script append the date to the file name? If so, how? 
      
      For example, "FileName_YYYY-MM-DD.csv". Or "YYYY-MM-DD_FileName.csv" Thanks. 
      
      Regards,
      Aaron
    • Hello Aaron,
      
      Simply change this line:
      
      $OutputFile = "SharedMailboxSizes.csv"
      
      To:
      $strDate = get-date -format yyyy-MM-dd
      $OutputFile = "SharedMailboxSizes_" + $strDate + ".csv"
      
      Let me know how you go!
      
      Regards,
      
      Alan