Ir al contenido principal

Entradas

Mostrando entradas de octubre, 2023

[O365] Find All Office 365 Group Owners using PowerShell

[O365] Find All Office 365 Group Owners using PowerShell #Connect to Exchange Online Connect-ExchangeOnline -ShowBanner:$False #Get All Office 365 Groups $GroupData = @() $Groups = Get-UnifiedGroup -ResultSize Unlimited  -SortBy Name   #Loop through each Group $Groups | Foreach-Object {     #Get Group Owners     $GroupOwners = Get-UnifiedGroupLinks -LinkType Owners -Identity $_.Id | Select DisplayName, PrimarySmtpAddress     $GroupData += New-Object -TypeName PSObject -Property @{             GroupName = $_.Alias             GroupEmail = $_.PrimarySmtpAddress              OwnerName = $GroupOwners.DisplayName -join "; "             OwnerIDs = $GroupOwners.PrimarySmtpAddress -join "; "             SharePointSiteUrl = $_.SharePointSiteUrl -join "; "             DisplayName =  $_.DisplayName -join "; "            } } #Get Groups Data #$GroupData $GroupData | Export-Csv "C:\Temp\GroupOwners.csv" -NoTypeInformation   #Disconnect Exchange Onli