đź”§ New: User Management Graph PowerShell Toolkit

Simplify user tasks like bulk creation, updates, password resets, deletions, license checks & more — all from one place.

🚀 Launch Toolkit

How to Archive Microsoft Teams Using Graph PowerShell?

Microsoft Teams is one of the most widely used collaboration tools in modern workplaces. As your organization grows, you might find yourself managing dozens—or even hundreds—of Teams. Over time, many of these Teams may no longer be active but still contain important information that must be preserved.

Instead of deleting them, you can archive Teams to make them read-only while retaining access to files, conversations, and channels. This article explains what Teams archiving is, how to archive Teams using Microsoft Graph PowerShell, and provides practical examples using the Invoke-MgArchiveTeam cmdlet.


What is Teams Archiving?

Archiving a Team means setting it to a read-only state where members can view conversations and files but can’t make changes.

This is particularly useful for:

  • Retaining project or department Teams that are no longer active.
  • Preserving collaboration history for audit or compliance.
  • Reducing clutter in active workspaces without losing important data.

When a Team is archived:

  • Members can still access files and messages.
  • Owners can unarchive the Team at any time.
  • The associated SharePoint site and files are also marked as read-only (if configured).

How to Archive Teams Using Graph PowerShell?

To archive Teams using Microsoft Graph PowerShell, follow these steps:

  1. Install and import the Microsoft Graph PowerShell module (if not already installed):
  2. Install-Module Microsoft.Graph
    Import-Module Microsoft.Graph
                                                
  3. Connect to Microsoft Graph with the required permissions:
  4. Connect-MgGraph -Scopes "Team.ReadWrite.All"
  5. Use the Invoke-MgArchiveTeam cmdlet to archive the desired Teams.

How to Use Invoke-MgArchiveTeam Cmdlet?

The Invoke-MgArchiveTeam cmdlet is used to archive a specific Microsoft Team by passing its unique Team ID.

Once archived, members can still access the Team’s content, but all operations become read-only.

Syntax:

Invoke-MgArchiveTeam -TeamId

Parameter:

  • -TeamId – Specifies the unique identifier (GUID) of the Team to be archived.

Invoke-MgArchiveTeam Examples

Let’s look at practical examples of archiving Teams using Microsoft Graph PowerShell.


  • Example 1: Archiving a Single Team
  • $$TeamId = "72bd013b-42ff-4b6e-b84b-5209e3b22bcb"
    Invoke-MgArchiveTeam -TeamId $TeamId
                                                

    This command archives the specified Team, setting it to a read-only state for all users.

  • Example 2: Archiving Multiple Teams
  • $TeamIds = @("72bd013b-42ff-4b6e-b84b-5209e3b22bcb", "33d343b2-123e-42af-9f2c-6dcfd8ac8d45")
    foreach ($TeamId in $TeamIds) {
        Invoke-MgArchiveTeam -TeamId $TeamId
    }
                                                

    This script loops through the list of Team IDs and archives each Team one by one.

  • Example 3: Bulk Archiving Teams Using a CSV File
  • For large organizations, it’s often easier to manage Team archiving through a CSV file.

    Create a CSV file named teams-to-archive.csv with the following structure:

    TeamId
    72bd013b-42ff-4b6e-b84b-5209e3b22bcb
    33d343b2-123e-42af-9f2c-6dcfd8ac8d45
    f5a7713b-9c1e-48d2-8a42-d56d634ab213
                                                

    Then, run this PowerShell script:

    $Teams = Import-Csv -Path "C:\path\to\teams-to-archive.csv"
    foreach ($Team in $Teams) {
        Invoke-MgArchiveTeam -TeamId $Team.TeamId
    }
                                                

    This script imports the CSV, iterates through each entry, and archives every Team listed.


Conclusion

Archiving Teams using Graph PowerShell is a clean and efficient way to manage inactive Teams while maintaining data integrity.

The Invoke-MgArchiveTeam cmdlet allows administrators to easily archive individual Teams, multiple Teams, or even automate the process using CSV files.

By incorporating this cmdlet into your regular maintenance tasks, you can ensure a well-organized Teams environment—keeping your tenant clutter-free while retaining essential collaboration history.


Did You Know? Managing Microsoft 365 applications is even easier with automation. Try our Graph PowerShell scripts to automate tasks like generating reports, cleaning up inactive Teams, or assigning licenses efficiently.

Ready to get the most out of Microsoft 365 tools? Explore our free Microsoft 365 administration tools to simplify your administrative tasks and boost productivity.

© Your Site Name. All Rights Reserved. Design by HTML Codex