In every Microsoft 365 organization, teams are created to manage project communications and files. Once the project ends, these teams may hold sensitive data that no longer needs to be accessed. Keeping them active not only increases compliance risks but also leads to a cluttered Teams environment. By archiving such inactive teams, organizations can retain information while maintaining security and compliance standards in Microsoft Teams.
- Log in to the Microsoft Teams admin center and navigate to the Teams»Manage teams.
- Select the inactive team and click Archive in the toolbar.
- In the pop-up, check 'Make the SharePoint site read-only for team members' to prevent people from editing the content in the SharePoint Online site and Wiki tab associated with the team.
- Then, select Archive in the confirmation pop-up to archive the team.
Note: Even when the SharePoint Online site is set to read-only mode, team owners will be able to edit the content.
Manual identification and archiving of inactive teams through the Teams admin center can be error-prone and time-consuming. Instead, you can run the PowerShell command to quickly detect unused teams based on a defined inactivity period and archive them efficiently.
Connect to the Microsoft Graph PowerShell module using the cmdlet below.
To get the Team ID of a specific team, you can use the following cmdlet:
Then, run the following cmdlet in PowerShell to archive a specific inactive team in Microsoft 365.
Replace <TeamId> with the actual ID of the team you want to archive before executing the cmdlet.
Archiving inactive teams manually via Teams admin center or using individual PowerShell cmdlets requires multiple steps and repetitive actions, which makes the process inefficient especially in large environments. That's why we have developed a PowerShell script to automate the entire process. It retrieves activity data, filters teams based on inactivity, and archives multiple teams in one go-saving time and reducing the chance of human error.
ArchiveInactiveTeams.ps1To archive all teams that have been inactive for the past 180 days, run the PowerShell script as mentioned below.
.\ArchiveInactiveTeams.ps1 -InactiveDays 180 -ArchiveInactiveTeams