🎉 Our Office 365 Reporting Tool is now available in Azure Marketplace 🚀
This website uses cookies to improve your experience. We'll assume you're ok with this. Know more.
Microsoft Teams

How to Find Inactive Teams in Microsoft 365

Inactive teams in Microsoft 365 often persist after a project ends and may go unnoticed. Without proper oversight, these unused teams can create security risks and lead to data leaks. This guide shows how to identify inactive teams in Microsoft 365, apply the right controls, limit unnecessary access, and keep your Microsoft Teams environment secure.

Get Last Activity Date of Teams Using Microsoft 365 Admin Center

Microsoft 365 Permission Required
Reports Reader Least Privilege
Global Admin Most Privilege
  • Log in to the Microsoft 365 admin center.
  • Navigate to Reports»Usage»Microsoft Teams and then select the Teams usage tab.
  • Here, you can view the last activity date of all teams in Microsoft 365 to find inactive teams.
Get Last Activity Date of Teams Using Microsoft 365 Admin Center
  • Note: There is no direct way to identify inactive teams in the admin center, but you can determine inactivity by reviewing the last activity date of each team.

List All Inactive Teams in Microsoft 365 Using Windows PowerShell

Microsoft 365 Permission Required
Reports Reader Least Privilege
Global Admin Most Privilege
  • Connect to the Microsoft Graph PowerShell module with required permissions using the cmdlet below.
  • Windows PowerShell Windows PowerShell
     Connect-MgGraph –Scopes "Reports.Read.All"
  • Run the following cmdlet to get the last activity date of all teams in Microsoft 365.
  • Windows PowerShell Windows PowerShell
     Get-MgReportTeamActivityDetail -Period <Days> -OutFile <FilePath>
  • Replace <Days> with D7, D30, D90, or D180 to specify the reporting period and replace <FilePath> with the desired file location to save the report.
List All Inactive Teams in Microsoft 365 Using Windows PowerShell
  • The exported report includes details like team name, ID, last activity date, activity metrics, external engagement and more. You can filter the last activity date to identify teams with no activity after a specific date or teams that have never been used.

Export Microsoft Teams Inactivity Report Using PowerShell Script

Microsoft 365 Permission Required
Reports Reader Least Privilege
Global Admin Most Privilege
  • The above PowerShell command retrieves activity data and requires manual filtering to identify inactive teams, which can be time-consuming, especially in large environments.
  • To simplify this, we've created a PowerShell script that automatically exports activity details and filters inactive teams based on a specified date.
  • The report includes inactive teams along with key details such as team name, team type, last activity date, inactive days, deleted status, and team id.
  • Simply download the script below and run it in PowerShell to get a ready-to-use inactive teams report across your organization.
Export Microsoft Teams Inactivity Report Using PowerShell Script
FindInactiveTeams.ps1

Identify Inactive Teams in Microsoft 365 to Clean Up and Streamline Teams Management!

AdminDroid’s Microsoft Teams reporting tool helps you find inactive teams across your organization by analyzing chat messages, meeting activity, file sharing, and more. It ensures efficient Microsoft Teams management by highlighting teams that haven’t shown recent activity.

Review All Deleted Inactive Teams and Restore Important Ones in Time

Identify and recover recently deleted teams that were previously inactive to prevent unintentional loss of historical data, project context, and critical conversations that may still hold value for future reference or audits.

Remove Unused Teams in Microsoft 365 to Improve Oversight

Find empty teams with no members or owners using AdminDroid, and take action to remove or repurpose them to maintain a clean environment, minimize overhead in team administration, and enhance overall M365 governance.

Spot Inactive Users to Reduce Teams Licensing Cost

Detect inactive teams users with no recent meetings, chats, or calls, and revoke Teams add-on licenses to cut Microsoft 365 costs, streamline user management, and maximize license efficiency.

Analyze Teams User Activities to Optimize Teams Lifecycle

Monitor overall teams user activities such as messaging, meetings, and channel engagement across all Microsoft Teams to identify inactivity trends and take timely action to archive or renew them for better collaboration flow.

Track and Manage Inactive Teams in Microsoft 365

Utilize AdminDroid's inactive teams report collection to find teams based on the last unique message sent, last message post and reply, last reaction, and last meeting organized, to ensure that only users of active and relevant teams retain access to resources.

Identify Teams Exceeding SharePoint Storage Limits

Get a list of teams with file storage over warning quota to manage storage issues proactively, prevent upload restrictions, and ensure uninterrupted collaboration within Microsoft Teams.

Overall, AdminDroid’s Microsoft Teams management tool empowers IT admins with deep visibility into inactive teams, their owners, user activities, and lifecycle trends. It helps prevent license wastage, recover recently deleted teams, assign team ownership, and clean up empty teams, thereby making team governance easier and more efficient.

Explore a full range of reporting options

Important Tips

Set up Microsoft 365 group expiration policy to automatically remove inactive teams, which helps to reduce clutter and ensures your Teams environment stays clean and actively maintained.

Use Teams naming conventions with project codes or time-based tags to identify purpose-driven teams and archive them after project completion to prevent further edits.

Assign owners for inactive ownerless teams to ensure accountability, support lifecycle management, and prevent teams from becoming unmanaged over time.

Common Errors and Resolution Steps

The following are the possible errors and troubleshooting hints while exporting inactive teams usage report.

Error Needs permission to access resources in your organization that only an admin can grant. Please ask an admin to grant permission to this app before you can use it.

This error occurs when a user or least privileged admin tries to connect to the Microsoft Graph PowerShell module without an admin consent on behalf of the organization.

Fix Grant admin consent for the ‘Reports.Read.All’ permission by going to Microsoft Entra admin center»Applications»App registrations. Then, select the respective app and go to API permissions to grant consent on behalf of the organization to allow users to run the cmdlet.

Error Get-MgReportTeamActivityDetail : {"error":{"code":"S2SUnauthorized","message":"Invalid permission."}}

This error occurs when executing the 'Get-MgReportTeamActivityDetail' cmdlet in PowerShell without necessary scope permissions or role assignments.

Fix Ensure you have at least the Reports Reader role and then connect to the Microsoft Graph PowerShell with Reports.Read.All permission.
Connect-MgGraph –Scopes "Reports.Read.All"

Error Information is concealed for privacy. To see identifiable information, learn about showing these details in reports.

This error occurs while accessing Microsoft Teams usage reports in the Microsoft 365 admin center when your organization has enabled the 'Display concealed names in all reports' setting.

Fix To view user display names in the Teams usage report, enable identifiable usernames in the Microsoft 365 admin center.

Error Get-MgReportTeamActivityDetail : {"error":{"code":"InvalidArgument","message":"Invalid date value specified: 2025-01-01. Only support data for the past 28 days."}}

This error occurs when running the 'Get-MgReportTeamActivityDetail' cmdlet in PowerShell with the -Date parameter set to a value outside the 28-day limit supported by the Microsoft Graph Reports API.

Fix Instead of using the -Date parameter with a specific value, use the -Period parameter with supported options like D7, D30, D90, or D180. The -Date parameter is only valid if the specified date is within the past 28 days.

1. How to archive inactive teams in Microsoft Teams?

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.

Archive an inactive team in Microsoft Teams admin center

  • 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.
archive-teams-in-ms-teams-admin-center

Note: Even when the SharePoint Online site is set to read-only mode, team owners will be able to edit the content.

Archive inactive teams using Microsoft Graph PowerShell

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.

Connect–MgGraph –Scopes "TeamSettings.ReadWrite.All"

To get the Team ID of a specific team, you can use the following cmdlet:

Get-MgTeam -Filter "displayName eq '<TeamName>'"

Then, run the following cmdlet in PowerShell to archive a specific inactive team in Microsoft 365.

Invoke-MgArchiveTeam -TeamId <TeamId> -ShouldSetSpoSiteReadOnlyForMembers

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.ps1

To archive all teams that have been inactive for the past 180 days, run the PowerShell script as mentioned below.

.\ArchiveInactiveTeams.ps1 -InactiveDays 180 -ArchiveInactiveTeams

archive-inactive-teams-in-m365-using-ps-script

2. What happens to a team in Microsoft 365 when its group expires?

Whenever a team is created, a Microsoft 365 group is automatically created to support it. Microsoft Teams relies on these groups for its structure and functionality. When group expiration policies are enabled, teams linked to those groups are affected too. By Understanding what happens to teams when a group expires helps IT admins manage Microsoft Teams effectively. It also helps avoid unintended data loss and maintain control over the collaboration lifecycle.

Lifecycle of a team after group expiration in Microsoft 365

1. Renewal notifications are sent to team owners:

  • Notifications are sent 30 days, 15 days, and 1 day before the expiration date.
  • When the group expiration policy is applied and there is no owner for a group, renewal notifications are sent to the configured alternate email address.
  • Owners can renew the team directly from the email or by selecting Renew now from within the team settings in Microsoft Teams.

2. If no action is taken, the Microsoft 365 group expires:

  • The entire team linked to the group is deleted, including chat history, files, calendar events, and shared resources.
  • As a result, team members lose access to that specific team immediately.

3. The deleted team is recoverable for 30 days:

  • During this soft-delete period, an admin can restore the group and the team using Microsoft Entra admin center or PowerShell.
  • After 30 days, the team and all its content are permanently removed.

Note: Encourage team owners to act on expiration emails to avoid data loss. If your teams don’t have owners, configure a backup contact in the expiration policy settings.

Auto-renewal helps keep active teams from being deleted

  • Sometimes, team owners may miss renewal notifications due to oversight or absence which can result in deletion of actively used teams under an expiration policy.
  • To avoid this, auto-renewal is enabled by default for teams under the group expiration policy. If any team member visits a channel before the team’s expiration date, the team is automatically renewed. This ensures active teams remain available without requiring manual action from the owner.

Group expiration doesn’t just clean up inactive Teams, it initiates a defined lifecycle that includes notifications, deletion, and recovery options. By staying informed about each stage, admins can prevent unintentional data loss, ensure critical teams are renewed on time, and maintain a streamlined Teams environment.

3. How to check teams expiration and renewal in Microsoft Teams?

When the Microsoft 365 group expiration policy is enabled, unmonitored team expiration can result in unexpected deletions, disrupt ongoing projects and team collaboration. Regularly checking expiration and renewal status enables admins to take early action and maintain a secure MS Teams environment.

Manage expiring teams in Microsoft Teams admin center

  • Log in to the Microsoft Teams admin center and navigate to Teams»Manage teams.
  • Apply a filter on the Expiration date to list all teams set to expire within the next 7, 14 and 30 days.
  • Select one or more of these teams and click the Renew option to extend their lifespan and prevent auto-deletion.
teams-expiration-status-in-microsoft-365

Get soon-to-expire teams using Microsoft Graph PowerShell

Connect to the Microsoft Graph PowerShell module using the cmdlet below.

Connect-MgGraph -Scopes "Group.Read.All"

Run the following cmdlet in PowerShell to retrieve all expiring teams in your Microsoft 365 environment.

Get-MgGroup | Where-object { ($_.ExpirationDateTime -ne $null) -and ($_.AdditionalProperties.resourceProvisioningOptions -eq 'Team') } | Select-Object CreatedDateTime, ExpirationDateTime, DisplayName, Mail, RenewedDateTime, Id | Format-Table
list-all-expiring-teams-powershell-m365

Manual tracking team expiration and renewal status is difficult in the Teams admin center, and even PowerShell demands time to script and maintain. AdminDroid simplifies this task with timely reports that offer complete visibility

Get insights into the Teams expiration policy in Microsoft 365 with AdminDroid!

  • AdminDroid’s expiring teams report helps you stay ahead of soon-to-expire teams in MS Teams by offering detailed visibility into expiration timelines to take timely action and avoid unintended deletions.
  • Here, you can review expiring teams with details such as expiration date time, team name, team's mail, team privacy, members, and more.
get-expiring-teams-report-admindroid

Handy tip: Utilize the Schedule (⏰) option available within the report to receive regular insights via email in formats such as CSV, PDF, XLS, and more.

Kickstart Your Journey With
AdminDroid

Your Microsoft 365 Companion with Enormous Reporting Capabilities

Download Now
User Help Manuals Compliance Docs
x
Delivering Reports on Time
Want a desired Microsoft 365 reports every Monday morning? Ensure automated report distribution and timely delivery with AdminDroid's Scheduling to your email anytime you need.
Delivering Reports on Time
Schedule tailored reports to execute automatically at the time you set and deliver straight to the emails you choose. In addition, you can customize report columns and add inteligent filtering to the activities just from the previous day to suit your Microsoft 365 report requirements.
Set It, Schedule It, See Results- Your Reports, Your Way, On Your Time!
Time Saving
Automation
Customization
Intelligent Filtering
Give Just the Right Access to the Right People
Grant fine-tuned access to any Microsoft 365 user with AdminDroid’s Granular Delegation and meet your organization’s security and compliance requirements.
Give Just the Right Access to the Right People
Create custom roles loaded with just the right permissions and give access to admins or normal users within AdminDroid. The result? A streamlined Microsoft 365 management experience that aligns your organization's security protocols and saves your invaluable time and effort.
Align, Define, Simplify: AdminDroid's Granular Delegation
Smart Organizational Control
Effortless M365 Management
Simplified Access
Advanced Alerts at a Glance
Receive quick notifications for malicious Microsoft 365 activities. Engage with the AdminDroid’s real-time alert policies crafted to streamline your security investigations.
Advanced Alerts at a Glance
Stay informed of critical activities like suspicious emails and high-risk logins, bulk file sharing, etc. Through creating and validating ideal alert policies, AdminDroid provides a comprehensive approach to real-time monitoring and management of potential threats within your organization.
AdminDroid Keeps You Always Vigilant, Never Vulnerable!
Proactive Protection
Real-time Monitoring
Security Intelligence
Threat Detection
Merge the Required Data to One Place
Combine multiple required columns into one comprehensive report and prioritize the information that matters most to you with AdminDroid’s Advanced Column Customization.
Merge the Required Data to One Place
This column merging capability offers a flexible way to add different columns from various reports and collate all the essential data in one place. Want to revisit the customized report? Save it as a 'View’, and your unique report is ready whenever you need it.
Merge with Ease and Save as Views!
Custom Reporting
Unique View
Desired Columns
Easy Data Interpretation
Insightful Charts and Exclusive Dashboards
Get a quick and easy overview of your tenant's activity, identify potential problems, and take action to protect your data with AdminDroid’s Charts and Dashboards.
Insightful Charts and Exclusive Dashboards
With AdminDroid charts and dashboards, visualize your Microsoft 365 tenant in ways you've never thought possible. It's not just about viewing; it's about understanding, controlling, and transforming your Microsoft 365 environment.
Explore Your Microsoft 365 Tenant in a Whole New Way!
Executive overviews
Interactive insights
Decision-making
Data Visualization
Efficient Report Exporting for Microsoft 365
Downloading your reports in the right file format shouldn’t be a hassle with AdminDroid’s Report Export. Experience seamless report exporting in various formats that cater to your needs.
Efficient Report Exporting for Microsoft 365
Navigate through diverse options and export Microsoft 365 reports flawlessly in your desired file format. Tailor your reports precisely as you need them and save them directly to your computer.
Take Control, Customize and Deliver- Your Office 365 Data, Exported in Your Way!
Easy Export
Seamless Downloading
Data Control
Manage Microsoft 365

Get AdminDroid Office 365 Reporter Now!