Entra / Microsoft 365 · Exchange Online
Report yammer community activity
Report the activity of Yammer communities (for networks configured in Microsoft 365 mode) using the compliance records stored in Exchange Online.
Connect & set up
Run these once per session. All scopes are read-only unless the script makes changes.
Connect-ExchangeOnline -ShowBanner:$false
Run it
The main script. Copy it, or download the .ps1 and run it from your console.
$ModulesLoaded = Get-Module | Select NameIf (!($ModulesLoaded -match "ExchangeOnlineManagement")) {Write-Host "Please connect to the Exchange Online Management module and then restart the script"; break}[array]$YammerGroups = Get-UnifiedGroup -ResultSize Unlimited |?{$_.GroupSku -eq "Yammer"}If (!($YammerGroups)) {Write-Host "No Microsoft 365 Groups found for Yammer -exiting"; break}$YammerData = [System.Collections.Generic.List[Object]]::new()ForEach ($Group in $YammerGroups) {Write-Host "Processing" $Group.DisplayName$Folder = (Get-ExoMailboxFolderStatistics -Identity $Group.ExternalDirectoryObjectId -Folderscope NonIPMRoot -IncludeOldestAndNewestItems | ?{$_.FolderType -eq "Yammer"})If ($Folder.NewestItemReceivedDate) {$TimeSincePost = New-TimeSpan ($Folder.NewestItemReceivedDate)$FormattedTime = "{0:dd}d:{0:hh}h:{0:mm}m" -f $TimeSincePost }Else {$FormattedTime = "N/A" }$ReportLine = [PSCustomObject][Ordered]@{DisplayName = $Group.DisplayNameItems = $Folder.ItemsInFolderNewestItem = $Folder.NewestItemReceivedDateTimeSincePost = $FormattedTime }$YammerData.Add($ReportLine)} # End For$YammerData | Sort Items -Descending | Out-GridView
Attribution
Author
Office365itpros