Managing 400+ Teams


Hi All,


I am helping a client how has more than 400 teams in their environment. I told them to a script to restrict Office 365 Groups using following this link:


However, how to manage their Teams that may not be used OR users created just for testing purposes and any best practice around on this .

Could I follow this strategy?


  1. Export All Teams and Owners to CSV:

  2. Check for Inactive Teams:

  3. Contact the owners and ask for the purpose of their respective teams.   

  4. Clean up / purge inactive and unnecessary teams.

Any suggestion please?
Any pointers will be highly appreciated.   

@Vasil Michev  @Tony Redmond 

4 Replies

@Aroh Shukla Why not use a Groups expiration policy to remove unused groups automatically?


BTW, the link to the TechNet gallery for the script to analyze inactive Teams and groups is now incorrect as the Gallery is no longer being used. You can find details of the latest version of the script (4.7) at 

@Tony Redmond thank you so much for super fast reply. 

what are options if client does not have subscribed to Azure Active Directory P1 license? 



best response confirmed by Aroh Shukla (Contributor)

@Aroh Shukla 


Run the Teams and Groups activity report and use the CSV it generates to decide which teams to remove. You could easily script some PowerShell to read the CSV and send email to the team owners before you remove the teams.

@Tony Redmond and you are simply awesome. Thank you!