How to Remove Classic Microsoft Teams with PowerShell and Intune Proactive Remediations

Microsoft officially retired Classic Teams on July 1, 2025, and the client is no longer functional. Despite this, many organizations still have remnants of Classic Teams scattered across their Windows device estate. This is not just a cosmetic issue. Classic Teams no longer receives security updates, the per-user installation model wastes disk space, leftover shortcuts confuse users, and end-of-life software can put you out of compliance. If you have been putting off the cleanup, now is the time to remove Classic Teams from your environment.

In this post I am sharing three PowerShell scripts that handle different scenarios, from a one-off standalone removal to a fully automated Intune Proactive Remediations approach.

Why You Need to Remove Classic Teams

Even though Classic Teams stopped working months ago, there are real reasons to actively remove it rather than just leaving it behind:

  • Security – Classic Teams no longer receives security updates, leaving a potential attack surface on your endpoints
  • Disk space – The per-user installation model means Classic Teams can consume hundreds of megabytes per user profile on a device
  • User confusion – Leftover shortcuts and autorun entries can confuse users, especially when New Teams is already deployed
  • Compliance – Many organizations have policies requiring the removal of end-of-life software from managed devices
  • Clean device state – Leftover registry entries and autorun configurations can interfere with New Teams or cause unexpected behavior

What Gets Removed

All three scripts target the same Classic Teams components:

  • Teams Machine-Wide Installer – The MSI-based installer typically deployed via SCCM, GPO, or during OS deployment
  • Per-user Teams installations – Classic Teams installed itself per-user under %LocalAppData%\Microsoft\Teams for each profile on the device
  • Autorun registry entries – Both HKLM and per-user Run keys that launch Classic Teams at logon
  • Desktop and Start Menu shortcuts – Leftover .lnk files pointing to the old Teams client
  • Teams Installer folder – The C:\Program Files (x86)\Teams Installer directory

Option 1: Remove Classic Teams with a Standalone Script

If you need to remove Classic Teams from a smaller number of devices, or want to run the cleanup through SCCM, ConfigMgr, GPO, or manually, use the standalone removal script. It handles the complete removal process in a single run: stops Teams processes, uninstalls the Machine-Wide Installer via msiexec, iterates through all user profiles to remove per-user installations, cleans up registry entries and shortcuts, and validates the result.

Script: Remove-ClassicTeams.ps1

Usage

Run the script as SYSTEM or with local administrator privileges:

powershell.exe -ExecutionPolicy Bypass -File Remove-ClassicTeams.ps1

The script creates a log file at C:\Windows\Logs\Remove-ClassicTeams.log for troubleshooting.

Option 2: Remove Classic Teams with Intune Proactive Remediations

For organizations managing devices through Microsoft Intune, the preferred approach is to use Proactive Remediations (now called Remediations in the Intune admin center). This gives you a detection script that identifies non-compliant devices and a remediation script that automatically cleans them up.

Detection Script

The detection script checks whether you still need to remove Classic Teams by scanning all common locations. If any remnant is found, it exits with code 1 (non-compliant), which triggers the remediation script. If the device is clean, it exits with code 0 (compliant).

Script: Detect-ClassicTeams.ps1

The detection checks include:

  • Teams Machine-Wide Installer in both 32-bit and 64-bit uninstall registry keys
  • Classic Teams folder, Teams.exe, and Update.exe in each user profile
  • Teams desktop shortcuts across all profiles
  • HKLM Run entry for Teams

Remediation Script

When the detection script flags a device as non-compliant, the remediation script will remove Classic Teams and perform the full cleanup. It goes further than the standalone script by also cleaning Start Menu and Startup folder shortcuts, loading offline user registry hives to remove per-user Run entries, and removing the Teams Installer folder from Program Files.

Script: Remediate-ClassicTeams.ps1

After remediation, the script runs its own validation. If all remnants are successfully removed, it exits with code 0. If anything remains, it exits with code 1, which Intune will flag for review.

Setting Up the Proactive Remediation in Intune

  1. In the Intune admin center, navigate to Devices > Remediations
  2. Click Create script package
  3. Give it a name, for example: Remove Classic Microsoft Teams
  4. Upload Detect-ClassicTeams.ps1 as the detection script
  5. Upload Remediate-ClassicTeams.ps1 as the remediation script
  6. Set Run this script using the logged-on credentials to No (runs as SYSTEM)
  7. Set Run script in 64-bit PowerShell to Yes
  8. Assign the remediation to a device group – start with a pilot group before targeting all devices
  9. Set the schedule – daily is recommended until the bulk of devices are cleaned up, then reduce to weekly

Logging

All three scripts write detailed logs to C:\Windows\Logs:

  • Remove-ClassicTeams.log
  • Detect-ClassicTeams.log
  • Remediate-ClassicTeams.log

Each log entry includes a timestamp, severity level (INFO, WARN, ERROR), and a descriptive message, making it easy to verify that the scripts successfully remove Classic Teams. This makes it straightforward to troubleshoot any issues through Intune device diagnostics or by reviewing the log files directly.

Summary: Remove Classic Teams the Right Way

Cleaning up Classic Microsoft Teams is a necessary task for any organization that has migrated to New Teams. Whether you run the standalone script through your existing deployment tools or leverage Intune Proactive Remediations for automated, ongoing compliance, these scripts give you a reliable way to get it done.

All scripts are available on my GitHub:

If you have questions or run into issues, feel free to reach out.

2 thoughts on “How to Remove Classic Microsoft Teams with PowerShell and Intune Proactive Remediations”

  1. Interesting scripts. How would you handle environments that had Classic Teams in RDS, with userprofiles loaded from vhdx files (so only mounted when the user is logged in).

    • Hi Rob, good question – RDS with roaming profile containers (UPD or FSLogix) is the scenario where the per-user part of the cleanup gets tricky.

      The challenge is that the scripts run as SYSTEM and iterate over C:\Users, but on a session host the profiles are only mounted while a user is logged on. So the Machine-Wide Installer, the Teams Installer folder and the HKLM Run key get removed just fine, but the per-user copy of Classic Teams under %LocalAppData%\Microsoft\Teams lives inside the profile container and is never visible to the remediation.

      The way I would approach it:

      Run the machine-level cleanup on the session hosts first. Removing the Machine-Wide Installer is the important part, because it is the TeamsMachineInstaller Run entry that re-installs Classic Teams into every profile at logon. Once that is gone, no new per-user copies get created.
      Handle the per-user leftovers at logon, in the user’s context, when the profile is actually mounted. A small logon script (GPO, or an Intune script set to run with logged-on credentials) that removes %LocalAppData%\Microsoft\Teams, the HKCU Run entry and the desktop shortcut is enough. It only needs to run once per user, so I would drop a marker file or registry value so it skips on subsequent logons.
      If you use FSLogix, add the Teams folder to redirections.xml as an exclusion so it is no longer persisted in the container at all. That also gives you back the disk space in the VHDX files, which is often the real pain point on RDS.

      For the detection script on session hosts, I would limit it to the machine-level components, otherwise the devices will keep showing as non-compliant for profiles that simply are not mounted at the time the script runs.

      If you are seeing something different in your environment, let me know and I will take a look.

Feel free to comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.