Forum Discussion

Deleted's avatar
Deleted
Feb 08, 2018
Solved

O365 Group Mailbox Reports?

I'm trying to compile a PS report that will show me the size of each group mailbox within my O365 Groups.  Get-mailboxstatistics works for individual group mailboxes using the primarysmtpaddress, Identity, ID, etc., but I want to be able get them all using the Recipienttype, RecipienttypeDetails, or even MailboxtypeDetails (which shows as 'GroupMailbox' in the get-mailboxstatistics CMDLET).

 

I've tried filtering by the above (where-object), and then piping to get-mailboxstatistics but get nothing.

 

Despite looking, I haven't seen too much on this and I am anticipating a need for it for admin purposes.

Thanks!

 

It also made me wonder about how MS is going to approach these 'group mailboxes' from a licensing standpoint, esp since we're now required to assign an Exchange Plan 2 license to our shared/resource mailboxes.

  • The only reason you would need an EO2 license for shared/room mailbox is if you have enabled hold, and if you are applying a license anyway, you should just make it a user mailbox.

     

    Onto the Groups question, you can simply use the "calculated property" method:

     

    Get-UnifiedGroup  | select DisplayName,Recipient*,@{n="Size";e={(Get-MailboxStatistics $_.Identity).TotalItemSize}}
    
    DisplayName RecipientType                  RecipientTypeDetails Size
    ----------- -------------                  -------------------- ----
    Unified     MailUniversalDistributionGroup GroupMailbox         1.314 MB (1,377,400 bytes)
    First group MailUniversalDistributionGroup GroupMailbox         7.702 MB (8,076,248 bytes)

    You can add other properties as needed, but in general is better to write a proper script instead of using oneliners and the pipeline.

     

  • The basic steps are to form a collection of group mailboxes and then pipe the set to the Get-MailboxFolderStatistics cmdlet, selecting whatever properties you want to report. Something like this:

     

    PS C:\temp> get-unifiedgroup |get-mailboxstatistics | select displayname, itemcount, totalitemsize
    
    DisplayName ItemCount TotalItemSize
    ----------- --------- -------------
    Ignite 2016       149 787.1 KB (805,989 bytes)
    Managers          157 821 KB (840,711 bytes)
    Board Me...       160 876.6 KB (897,682 bytes)
    HR Worki...       125 548.6 KB (561,767 bytes)
    The Best...       757 7.157 MB (7,504,879 b...
    Mountain...       151 894.7 KB (916,189 bytes)
    Corporat...        86 569.8 KB (583,499 bytes)
    Stock ma...       189 1.523 MB (1,596,715 b...
    Interest...       160 1.141 MB (1,196,240 b...
    Sanjay P...       103 761.2 KB (779,429 bytes)
    Corporat...       225 1.761 MB (1,846,095 b...
    Budget P...       307 3.279 MB (3,437,958 b...
    Exchange...       209 2.79 MB (2,925,231 by...
    Exchange...      2389 180 MB (188,750,709 b...
    EHLO Blo...       177 1.37 MB (1,437,034 by...
    Technolo...       183 1.721 MB (1,804,383 b...
    Company ...       161 773.1 KB (791,669 bytes)
      • Deleted's avatar
        Deleted

        Thanks a lot TonyRedmond.  That Petri article gets me a long way toward what I was looking for - the ability to ID the predominant workload of a Group and understand better which services were generating the most groups.  

  • The only reason you would need an EO2 license for shared/room mailbox is if you have enabled hold, and if you are applying a license anyway, you should just make it a user mailbox.

     

    Onto the Groups question, you can simply use the "calculated property" method:

     

    Get-UnifiedGroup  | select DisplayName,Recipient*,@{n="Size";e={(Get-MailboxStatistics $_.Identity).TotalItemSize}}
    
    DisplayName RecipientType                  RecipientTypeDetails Size
    ----------- -------------                  -------------------- ----
    Unified     MailUniversalDistributionGroup GroupMailbox         1.314 MB (1,377,400 bytes)
    First group MailUniversalDistributionGroup GroupMailbox         7.702 MB (8,076,248 bytes)

    You can add other properties as needed, but in general is better to write a proper script instead of using oneliners and the pipeline.

     

    • rayman3115's avatar
      rayman3115
      Copper Contributor

      VasilMichev, does the EO2 license requirement for hold/retention apply to shared mailboxes created for O356 Groups and/or Teams as well?

    • Deleted's avatar
      Deleted

      Thanks VasilMichev.  The license question came up because our shared/resource MBX's are on hold via the 'Unified Retention Policy' and company policy.  

       

      AFAIK the Unified Retention Policy is auto-applied to all new <licensed> mailboxes.  With that in mind, does that change the licensing calculus of a group mailbox if my company is expecting its contents (including SPO site contents) to be held and discoverable?  

  • FWIW, exporting the groups to a CSV 1st via get-unifiedgroup, followed by an 'import-csv' and 'get-mailboxstatistics' provides a workaround. Not the most elegant, but at least I have my #'s.
    If anyone has a cleaner method I'd welcome it.

    $Users=Import-CSV "D:\Source\Scripts\CloudScripts\O365Groups\O365groupsreport.csv"
    $Users | ForEach-Object {
    get-mailboxstatistics -Identity $_.email | select displayname,primarysmtpaddress,mailboxtypedetail,itemcount,totalitemsize,deleteditemcount} | export-csv .\groupmailboxsizes.csv -NoTypeInformation

Resources