Find Archived MS Team Groups

Find archived Teams groups and review the example that compares them with groups created in the current year. The source notes that Get-Team does not return the creation timestamp.

Scenario 1: Find All Archived Team Groups

  1. Connect to Teams using: Connect To Teams
  2. Get all Teams/Groups that have been Archived $AllArchivedGroups = Get-Team -Archived $true

Read-More About Get-Team: Get-Team (MicrosoftTeams) | Microsoft Learn

Scenario 2: Find ArchivedGroups that were created in the current year.

Limitation: Get-Team doesn't return the Created DateTime for the group.

Compare with groups created this year

  1. Extract GroupId's from all Archived Groups
$ListOfArchivedGroupId = $AllArchivedGroups.GroupId
  1. Get All Groups created in the current year
Connect-MgGraph
$currentYear = (Get-Date).Year
$GroupsFromCurrentYear = Get-MgGroup -All | Where-Object { $_.CreatedDateTime.Year -eq $currentYear}
  1. Get GroupId's of all Groups Created in the current year
Connect-MgGraph
$currentYear = (Get-Date).Year
$GroupIdsFromCurrentYear = Get-MgGroup -Select Id,CreatedDateTime -All | Where-Object { $_.CreatedDateTime.Year -eq $currentYear } | Select-Object -ExpandProperty Id