Forum Discussion
SteveM72
May 20, 2020Copper Contributor
Identifying Inactive Teams
Hello, I am trying to identify inactive Teams, I work for a reasonably sized company so we have hundreds of Teams setup. I have tried running a Usage Report but that only shows Teams that have ha...
Kidd_Ip
Aug 07, 2024MVP
Take this:
# Connect to Microsoft Teams
Connect-MicrosoftTeams
# Get all Teams
$teams = Get-Team
# Loop through each Team and check activity
foreach ($team in $teams) {
$activity = Get-TeamUserActivityUserDetail -TeamId $team.GroupId -StartDate (Get-Date).AddDays(-90)
if ($activity.Count -eq 0) {
Write-Output "Team $($team.DisplayName) is inactive."
}
}