Simplify user tasks like bulk creation, updates, password resets, deletions, license checks & more — all from one place.
🚀 Launch ToolkitKeeping track of collaboration trends in Microsoft Teams is vital for every Microsoft 365 administrator. Whether it’s monitoring how active your departments are, identifying inactive Teams, or reviewing adoption growth — Microsoft Graph PowerShell gives you a direct way to pull these insights.
In this article, we’ll explore the Get-MgReportTeamActivityCount cmdlet — your go-to tool for exporting Teams activity metrics without ever opening the admin center.
The Get-MgReportTeamActivityCount cmdlet generates Teams activity reports for a given time period.
You can retrieve metrics such as:
It’s a perfect fit for IT admins who want quick visibility into collaboration trends or need monthly usage summaries.
Before running the cmdlet, make sure you’ve got the right setup.
Install-Module Microsoft.Graph -Scope CurrentUser
Update-Module Microsoft.Graph
Connect-MgGraph -Scopes "Reports.Read.All"
Get-MgReportTeamActivityCount -Period <String> -OutFile <String>
Get-MgReportTeamActivityCount -Period "D7" -OutFile ".\TeamsActivity_D7.csv"
This gives you a quick look at the most recent activity patterns — great for weekly reporting.
Get-MgReportTeamActivityCount -Period "D30" -OutFile ".\TeamsActivity_D30.csv"
Ideal for monthly summaries or adoption tracking reports.
Get-MgReportTeamActivityCount -Period "D180" -OutFile ".\TeamsActivity_D180.csv"
Use this for half-year trend analysis or management reports.
You can combine two CSV exports to see how Teams activity evolved.
$D30 = Import-Csv .\TeamsActivity_D30.csv
$D180 = Import-Csv .\TeamsActivity_D180.csv
$comparison = foreach ($team in $D180) {
$recent = $D30 | Where-Object { $_.ReportDate -eq $team.ReportDate }
if ($recent) {
[pscustomobject]@{
ReportDate = $team.ReportDate
ActiveTeamsChange = [int]$recent.ActiveTeams - [int]$team.ActiveTeams
MessageChange = [int]$recent.TeamChatMessages - [int]$team.TeamChatMessages
}
}
}
$comparison | Format-Table -AutoSize
| Error | Cause | Solution |
|---|---|---|
| Period is out of allowed range | You used a value greater than 180 days | Use only D7, D30, D90, or D180 |
| Insufficient privileges to complete the operation | You didn’t connect with the right permission | Reconnect with Connect-MgGraph -Scopes "Reports.Read.All". |
| Access denied / Forbidden | Conditional Access or tenant restrictions | Try with a global admin account or from an approved network |
| CSV empty or missing expected columns | Data latency or no activity in the selected range | Retry with a longer period like D30 or D90 |
The Get-MgReportTeamActivityCount cmdlet provides a quick and reliable way to understand how Teams is being used in your organization — no GUI required.
With just a few lines of PowerShell, you can automate collaboration reporting, compare growth periods, and visualize user engagement trends directly from the exported CSV.
By pairing this with other reporting cmdlets like Get-MgReportMailboxUsageDetail and Get-MgReportM365AppUserCount, you’ll have a complete 360° view of Microsoft 365 usage.
Did You Know? Managing Microsoft 365 applications is even easier with automation. Try our Graph PowerShell scripts to automate tasks like generating reports, cleaning up inactive Teams, or assigning licenses efficiently.
Ready to get the most out of Microsoft 365 tools? Explore our free Microsoft 365 administration tools to simplify your administrative tasks and boost productivity.
© Your Site Name. All Rights Reserved. Design by HTML Codex