Skip to main content
Question

Classic Teams Uninstall


Forum|alt.badge.img

I have a full script that uninstalls Teams classic as Microsoft is pushing the new teams however I cannot get it to work properly by breaking it up. I put this in for the evaluation and remediation - could someone with automox savviness assist?

 

Evaluation

#Locate installation folder
    $localAppData = "$($env:LOCALAPPDATA)\Microsoft\Teams"
    $programData = "$($env:ProgramData)\$($env:USERNAME)\Microsoft\Teams"
    If (Test-Path "$($localAppData)\Current\Teams.exe") 
    {
      unInstallTeams($localAppData)

    }
    elseif (Test-Path "$($programData)\Current\Teams.exe") {
      unInstallTeams($programData)
    }
    else {
      Write-Warning  "Teams installation not found"
    }

Remediation

function unInstallTeams($path) {
  $clientInstaller = "$($path)\Update.exe"

   try {
        $process = Start-Process -FilePath "$clientInstaller" -ArgumentList "--uninstall /s" -PassThru -Wait -ErrorAction STOP
        if ($process.ExitCode -ne 0)
    {
      Write-Error "UnInstallation failed with exit code  $($process.ExitCode)."
        }
    }
    catch {
        Write-Error $_.Exception.Message
    }
    }

 

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings