SCCM - How to Deploy the New Microsoft Teams and be able to reinstall it from software center?

MTrn 481 Reputation points
2024-02-13T15:50:43.8933333+00:00

Hi, The new MS Teams (work or school) is now msix. If install manually, I have to use the bootstrapper (ie: .\teamsbootstrapper.exe -p -o "c:\path\to\teams.msix"). So I created application deployment in SCCM, it can take the msix file. The deployment is good for first time installation only, but when we uninstall the new teams and try to reinstall it from software center, we encounter this error and the details show "Cannot create a file when that file already exists". User's image

I have been googling this for days but to no avail. If I manually install the new teams using bootstrapper, then it works, but can't reinstall from Software Center. Yes, I deleted the ccmcache. It redownloaded the package then errored out. Is there a proper way to deploy the new teams? Thank you!

Microsoft Configuration Manager
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. AllenLiu-MSFT 40,321 Reputation points Microsoft Vendor
    2024-02-21T06:05:56.5466667+00:00

    Hi, @MTrn

    Thanks very much for your feedback. We're glad that the problem is solved now. Here's a short summary for the problem, we believe this will help other users to search for useful information more quickly.

    Problem/Symptom:

    When deploy the New Microsoft Teams with SCCM, the deployment is good for first time installation only, but when uninstall and reinstall it from software center, the error "Cannot create a file when that file already exists" will show up.

    Solution/Workaround:

    Use a PowerShell script will make the deployment easier and dynamic by downloading the latest teamsbootstrapper.exe as well dynamically so we don't have to update our application in Configuration Manager when it is updated.

    Reference Link:

    https://ccmexec.com/2023/11/install-new-teams-client-with-powershell-with-or-without-content/

    https://github.com/suazione/CodeDump/blob/main/Install-MSTeams.ps1


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click ""Add Comment".

    1 person found this answer helpful.

  2. AllenLiu-MSFT 40,321 Reputation points Microsoft Vendor
    2024-02-14T02:29:04.28+00:00

    Hi, @MTrn

    Thank you for posting in Microsoft Q&A forum. What's the error in AppEnforce.log?

    When you say "Cannot create a file when that file already exists", what file does it mean?


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Add comment".


  3. useratuser 0 Reputation points
    2024-03-15T18:24:58.9133333+00:00

    #######delete

    0 comments No comments

  4. TenOf11 1 Reputation point
    2024-03-28T21:13:47.5033333+00:00

    The -o option for teamsbootstrapper.exe requires an absolute path (it cannot use a relative path). Therefore, for Configuration Manager, we use batch files.

    As an example, and what is working for us, to install/uninstall the 24033.811.2738.2546 64-bit MSIX version for all users.

    Prerequisites

    • Use Manually specify the application information when creating the application. Do not use **Windows app package *.appx, *.appxbundle, .msix, .msixbundle)
    • install.cmd, uninstall.cmd, teamsbootstrapper.exe, MSTeams-x64.msix must be in the root of the application content directory.

    install.cmd

    @echo off
    pushd "%~dp0"
    teamsbootstrapper.exe -p -o "%~dp0MSTeams-x64.msix"
    

    uninstall.cmd

    @echo off
    pushd "%~dp0"
    teamsbootstrapper.exe -x
    

    Application Detection Script

    $Name = 'MSTeams'
    $Version = [System.Version]'24033.811.2738.2546'
    $Architecture = 'x64'
    
    $AppProvisionedPackage = Get-AppProvisionedPackage -Online | Where-Object DisplayName -eq $Name
    
    if ( $null -eq $AppProvisionedPackage ) {
    	return
    }
    
    $Installed = [System.Version]($AppProvisionedPackage.Version) -ge $Version -and ($AppProvisionedPackage.PackageName -split "_")[2] -eq $Architecture
    
    if ( $Installed -eq $true) {
    	Write-Output "Installed"
    }
    
    0 comments No comments