Microsoft Teams Audit Script

Analyze Teams and Groups activity to plan your migration effectively.

Last updated: 2025-01-15 Plan & Prepare

What the Script Analyzes

👥
Groups & Teams
💬
Channel Messages
📧
Mailbox Activity
📁
SharePoint Files

Overview

The Microsoft Teams Audit Script is a PowerShell tool that helps you understand your organization's Teams and Groups usage patterns. Originally from Petri IT Knowledgebase and enhanced by Cloudiway, this script generates comprehensive reports to help you plan migrations effectively.

Key Features

  • Discovers all Groups and Teams in your organization
  • Analyzes channel message counts and last activity dates
  • Tracks mailbox message volumes
  • Monitors SharePoint site creation and file access dates
  • Generates HTML and CSV reports

Requirements

PowerShell Modules Required

SharePoint Online PowerShell Module

Install-Module -Name Microsoft.Online.SharePoint.PowerShell

Microsoft Teams PowerShell Module

Install-Module -Name MicrosoftTeams

Administrator Access Required

You need SharePoint Online administrator and Teams administrator permissions to run this script successfully.

Installation

1

Download the Script

Download the teams.ps1 script from Cloudiway's website.

2

Install Required Modules

Open PowerShell as Administrator and install the required modules:

Install-Module -Name Microsoft.Online.SharePoint.PowerShell
Install-Module -Name MicrosoftTeams
3

Create Output Directory

Ensure the c:\temp directory exists, as reports will be saved there by default.

Usage Steps

1

Launch PowerShell

Open PowerShell (Run as Administrator recommended).

2

Connect to SharePoint Online

Connect using your tenant admin URL:

Connect-SPOService -Url https://yourtenant-admin.sharepoint.com
3

Connect to Microsoft Teams

Authenticate to Teams:

Connect-MicrosoftTeams
4

Execute the Script

Navigate to the script location and run:

.\teams.ps1
5

Access the Report

Open the generated report:

c:\temp\GroupsActivityReport.html

Understanding the Report

The script generates both HTML and CSV reports containing detailed activity information:

HTML Report

Visual, easy-to-read format with formatted tables and summary statistics.

GroupsActivityReport.html

CSV Report

Raw data format for Excel analysis and custom reporting.

GroupsActivityReport.csv

Report Data Points

  • Group/Team name and type
  • Channel message counts
  • Last channel activity date
  • Mailbox message volume
  • SharePoint site status
  • Last file access date

Migration Planning Use

Use the activity data to identify inactive Teams that may not need migration, prioritize active Teams for migration, and estimate migration scope based on message and file volumes.

Was this article helpful?

We value your feedback

Help us improve your experience

What would you like to share with us?

Need direct support? Open a ticket