Forum Discussion
HenrikAdolfsson
Jan 23, 2023Copper Contributor
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...
- Jan 23, 2023My 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
VasilMichev
Jan 23, 2023MVP
I'm sure we can harass TonyRedmond to update the script to properly handle multiple owners. Say by removing the zero index out of $GroupData[0]/using a proper loop 🙂
TonyRedmond
Jan 23, 2023MVP
I also updated the Microsoft Graph PowerShell SDK version of the group membership report described in https://office365itpros.com/2023/01/19/microsoft-365-groups-report-v2/ to output the email addresses of group owners. That script is probably closer to what you're looking for.