Forum Discussion

HenrikAdolfsson's avatar
HenrikAdolfsson
Copper Contributor
Jan 23, 2023
Solved

Export all owners email adress for all Office 365 groups

Hi! I have a script that exports all owners e-mail address for each Office 365 group to a csv file. The format of the csv file looks like below, one combination of Group and Owner on each row. Gr...
  • TonyRedmond's avatar
    TonyRedmond
    Jan 23, 2023
    My logic for only outputting one contact email address for an owner is that this is what I was asked to do by someone who explicitly requested the addition of this data...

    Anyway, replace:

    $GroupOwnerEmail = $GroupData[0].Mail }

    with

    $GroupUserMail = $GroupData.Mail -Join ", "

    and you'll get the email addresses of all the owners.

    BTW, the script is now at version 5.10, updated today to fix some annoying bugs introduced by Microsoft in the Get-ExoMailboxFolderStatistics cmdlet

Resources