How to Export out all Microsoft Group list with Members

Found on this link:



Power Shell as Administrator:

Connect to Tennent:



Use the following script to export a list of all Microsoft 365 groups and their members to a All-M365-Group-Members.csv file.




$groups = Get-UnifiedGroup -ResultSize Unlimited

$totalmbx = $groups.Count

$i = 1

$groups | ForEach-Object {

Write-Progress -activity “Processing $_.DisplayName” -status “$i out of $totalmbx completed”

$group = $_

Get-UnifiedGroupLinks -Identity $ -LinkType Member | ForEach-Object {

$member = $_

$Result += New-Object PSObject -property @{

GroupName = $group.DisplayName

Member = $member.Name

EmailAddress = $member.PrimarySMTPAddress

RecipientType= $member.RecipientType




$Result | Export-CSV “All-M365-Group-Members.csv” -NoTypeInformation -Encoding UTF8



Kon Belieu

Similar Posts