To curb the number of unused teams, as an admin, you can use Microsoft 365 group expiration policy to automatically clean up unused teams. Because teams are backed by groups, group expiration policies automatically apply to teams as well.
It's important to know that expiration is turned off by default. Administrators have to enable it for their organization if they want to use it. An administrator will have to enable the expiration policy and set the properties for it to take effect. To enable it, go to Microsoft Entra ID > Groups > Expiration. Here you can set the default group lifetime.
The group lifetime is specified in days and can be set to 180, 365 or to a custom value that you specify. The custom value has to be at least 30 days.
If the group doesn't have an owner, the expiration emails will go to the specified email.
You can set the policy for all of your groups, only selected groups (up to 500), or turn it off completely by selecting None. When You select None all groups which are active and pending for verification will have no expiration date. However, the groups that are already expired aren't impacted. Note that currently you can't have different policies for different groups.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.