# Teams-Old Intune Remediation

Old versions of Teams across your enterprise - ick.

If you're using Intune, let's banish these in from your computers way that doesn't get in the way of the user (especially when they're on a call).

# Table of Contents

  • Table of Contents
  • Purpose
  • Overview
  • Dependencies
  • Detection Script
  • Remediation Script
  • Usage
  • Inputs
  • Outputs
  • Notes

# Purpose

Documents both the detection and remediation scripts for legacy Microsoft Teams installations via Intune Remediation.

# Overview

This page covers both:

  • Detection script: Identifies legacy (non-AppX/MSIX) Teams installations, including Classic Teams, New Teams (per-user), and Teams Personal, and determines if remediation is required.
  • Remediation script: Removes legacy Teams (Classic, New, Personal), uninstalls non-AppX Teams, and removes Teams Personal AppX packages if present.

# Dependencies

# Detection Script

Logic:

  • Validates device name and scheduled remediation day (spread scheduling by hostname).
  • Checks if Teams is running or user is in a call/meeting (skips if so).
  • Detects:
    • Classic Teams (per-user and machine-wide)
    • New Teams (per-user)
    • Teams AppX/MSIX (Org and Personal)
  • Determines compliance:
    • Non-compliant if any legacy (non-AppX/MSIX) Teams found
    • Compliant if only Org Teams AppX/MSIX present
  • Exit codes:
    • 0: Compliant
    • 1: Non-compliant (remediation required)
    • 2: Off-schedule
    • 3: User in Teams call/meeting
    • 4: Device name ends in symbol (manual remediation)

Inputs: None required; uses environment, registry, and file system.

Outputs: Compliance status, details of detected Teams installations, log file in %TEMP%.

Documentation:

# Remediation Script

Logic:

  • Aborts if non-AppX Teams is running or user is in a Teams call/meeting (exit 3).
  • Removes legacy Teams folders (per-user and machine-wide).
  • Uninstalls non-AppX Teams via registry (excluding Office add-in).
  • Removes Teams Personal AppX packages for all users.
  • Logs all actions to %TEMP%\TeamsRemediation.log.
  • Exit codes:
    • 0: Success
    • 3: User in Teams call/meeting (skipped)

Inputs: None required; uses environment, registry, and file system.

Outputs: Actions taken, uninstall results, log file in %TEMP%.

Documentation:

# Usage

  • Both scripts are deployed as part of an Intune Remediation package.
  • Detection runs first; if legacy Teams is found, remediation is triggered.

# Inputs

  • No external parameters; all logic is self-contained.

# Outputs

  • Detection: Presence and details of legacy Teams, compliance status, log file.
  • Remediation: Actions taken, uninstall results, log file.

# Notes

  • See project standards for logging, error handling, and accessibility.