Close Menu
    Facebook X (Twitter) Instagram
    Sunday, July 20
    X (Twitter) LinkedIn
    All about Endpoint Management
    • Home
    All about Endpoint Management
    Home»CM2012»How to uninstall teams client using SCCM Configmgr

    How to uninstall teams client using SCCM Configmgr

    Eswar KonetiBy Eswar KonetiOctober 16, 2:14 pm3 Mins Read CM2012 19,334 Views
    Share
    Facebook Twitter LinkedIn Reddit

    Had request to uninstall teams as they had deployed the teams to users who not supposed to get it on their windows devices. Microsoft Teams brings together the full breadth and depth of Office 365, to provide a true chat-based hub for teamwork and give customers the opportunity to create a more open, fluid, and digital environment. Microsoft Teams is built on existing Microsoft technologies woven together by Office 365 Groups.

    In this post ,we will see how to uninstall  teams client using ConfigMgr by creating application or package and deploy to either users or computers .

    we can download Teams client 32bit or 64bit MSI and deploy to users or computers . When you deploy teams application ,it will be installed in that user's appdata folder.

    we have 2 options to uninstall teams 1) simple uninstall command line 2) powershell script

    Using command line ,we can create package or edit the teams application and edit the deployment type, add the uninstall program .

    image

    Uninstall program for teams uninstallation: "%LocalAppData%\Microsoft\Teams\Update.exe" --uninstall –s

    This command like simply uninstall the teams client but it wont cleanup the folder .

    There is 2nd method that we can use to uninstall teams client using powershell script.

    <#
    .SYNOPSIS
    This script allows you to uninstall the Microsoft Teams app and remove Teams directory for a user.
    .DESCRIPTION
    Use this script to clear the installed Microsoft Teams application. Run this PowerShell script for each user profile for which the Teams App was installed on a machine. After the PowerShell has executed on all user profiles, Teams can be redeployed.
    #>

    $TeamsPath = [System.IO.Path]::Combine($env:LOCALAPPDATA, 'Microsoft', 'Teams')
    $TeamsUpdateExePath = [System.IO.Path]::Combine($env:LOCALAPPDATA, 'Microsoft', 'Teams', 'Update.exe')

    try
    {
        if (Test-Path -Path $TeamsUpdateExePath) {
            Write-Host "Uninstalling Teams process"

            # Uninstall app
            $proc = Start-Process -FilePath $TeamsUpdateExePath -ArgumentList "-uninstall -s" -PassThru
            $proc.WaitForExit()
        }
        if (Test-Path -Path $TeamsPath) {
            Write-Host "Deleting Teams directory"
            Remove-Item –Path $TeamsPath -Recurse
        }
    }
    catch
    {
        Write-Error -ErrorRecord $_
        exit /b 1
    }

    Create a powershell script and deploy the script to collection . When you deploy the script ,make sure it runs with user account and also only when user logged in.

    since the teams client is installed in Appdata folder ,uninstall must run only when user logged in .

    Reference: https://docs.microsoft.com/en-us/microsoftteams/msi-deployment

    https://docs.microsoft.com/en-us/microsoftteams/scripts/powershell-script-teams-deployment-clean-up

    configmgr office 365 teams uninstall client SCCM uninstall teams client update.exe
    Share. Twitter LinkedIn Email Facebook Reddit

    Related Posts

    SCCM SQL Report – Compare Installed Apps on TWO Different Computers

    July 13, 10:35 am

    Exporting Intune Win32 Apps with All Properties Using PowerShell and Microsoft Graph

    June 30, 7:01 pm

    Optimize Your Intune Workflow with a Powerful Browser Extension

    March 22, 10:39 am

    2 Comments

    1. Prashanth on October 17, 2018 3:31 PM

      I would like Install Teams and need to diable Autostartup and while deploying I am getting error, It seems Detection not working properly.

      Request to provide me the installation details also.

      Thanks in Advance
      Prashanth

      Reply
      • Eswar Koneti on January 9, 2019 8:02 PM

        Hi,
        to disable teams auto startup ,you can use GPO to remove the runatonce registry key. refer this http://eskonr.com/2018/11/how-to-disable-or-enable-auto-start-of-teams-application-using-gpo/

        Regards,
        Eswar

        Reply

    Leave a ReplyCancel reply

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

    Sign Up

    Get email notifications for new posts.

    Author

    I’m Eswar Koneti ,a tech enthusiast, security advocate, and your guide to Microsoft Intune and Modern Device Management. My goal? To turn complex tech into actionable insights for a streamlined management experience. Let’s navigate this journey together!

    Support

    Awards

    Archives

    © Copyright 2009-2024 Eswar Koneti, All rights reserved.

    Type above and press Enter to search. Press Esc to cancel.