The script provided in this article performs an audit of the Microsoft Groups and Teams and tries to determine if it’s still being used.
The initial script can be found here: https://gallery.technet.microsoft.com/Check-for-obsolete-Office-c0020a42
It has been slightly modified to fix few bugs.
The current version of the Cloudiway script can be downloaded here.
What it does:
It connects to Office 365.
It finds all the groups and teams.
It counts the number of messages in channels and date of last post.
It counts the number of messages in th mailbox and date of last message.
It determines if the SharePoint site has been created and reports the last access date of files.
It generates a report. By default, the report is generated in c:\temp.
Modify these 2 variables to change the filenames and location of the reports.
$ReportFile = “c:\temp\GroupsActivityReport.html”
$CSVFile = “c:\temp\GroupsActivityReport.csv”
Pre Requisites:
This is a powershell script.
It relies on SharePoint Online Powershell modules and Microsoft teams Powershell modules.
Install SharePoint Online Powershell modules.
See how to use and install SharePoint Online Powershell modules.
Install-Module -Name Microsoft.Online.SharePoint.PowerShell
Install Microsoft Teams Powershell modules.
See how to use and Install Microsoft Teams Powershell modules.
Install-Module -Name MicrosoftTeams
How to use it:
Once the modules are installed, connect to SharePoint Online, then to Microsoft Teams, then run the script
- Open a Powershell prompt
- Run : Connect-SPOService. The url to connect to must be https://<tenantName>-admin.sharepoint.com
- Run : Connect-MicrosoftTeams
- Run .\teams.ps1
Wait for the completion of the script.
It will generate a html report in c:\temp\GroupsActivityReport.html