Find Archived MS Team Groups
In
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.
Source-derived reference
These notes were recovered from OneNote. Configuration, permissions and operating results have not been freshly verified. Confirm the applicable authority and environment before acting.
Scenario 1: Find All Archived Team Groups
- Connect to Teams using: Connect To Teams
- 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
- Extract GroupId's from all Archived Groups
$ListOfArchivedGroupId = $AllArchivedGroups.GroupId
- Get All Groups created in the current year
Connect-MgGraph
$currentYear = (Get-Date).Year
$GroupsFromCurrentYear = Get-MgGroup -All | Where-Object { $_.CreatedDateTime.Year -eq $currentYear}
- 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