Need to remove consumer teams (built in teams) from win11 devices

TechUST 606 Reputation points
2024-01-26T20:49:41.96+00:00

Hi Expert, "I need assistance in removing the built-in Teams application from both Windows 10 and Windows 11 machines. I have attempted various methods through Intune and SCCM but have been unsuccessful. I believe it may be possible through a PowerShell script, and although I have tried, it has not worked. Can you please help me with the PowerShell script of removing the built-in Teams application from win11 devices.

"I deployed the script 'Get-AppxPackage "Teams" -AllUsers | Remove-AppPackage -AllUsers' on Windows 11 devices through script method via intune but it appears to be ineffective."

I have reviewed the mentioned article, but unfortunately, I did not find a solution. However, I have confidence that the method outlined in the article titled 'Remove Win11 built-in Teams chat with Intune using PowerShell' could be effective. The challenge lies in customizing the script to remove the inbuilt teams. here you can help me to customize the PS1 script for the same.

-Disable Win11 built-in Teams chat with Intune using Settings Catalog (This method dosnt work)

-Disable Win11 built-in Teams chat with Intune using Custom OMA-URI- (This method dosnt work)

-Remove Win11 built-in Teams chat with Intune using Proactive Remediation (This method dosnt work)

-https://joymalya.com/disable-win11-built-in-teams-with-intune/#Disable_Win11_built-in_Teams_chat_with_Intune_using_Settings_Catalog

I am looking for a PS1 script that can reliably remove the built-in Teams application from Windows 11 devices, ensuring it does not automatically reinstall. Additionally, I would appreciate it if you could test the script in your lab environment. My goal is to create a Win32 package using a PowerShell script in Intune to efficiently remove Teams from multiple devices ( win11) in one go so please suggest detection logic as well.

 

Microsoft Security | Intune | Other
Microsoft System Center | Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Dominion Chukwuma 5 Reputation points
    2024-01-27T20:11:59.0133333+00:00

    For Windows 10 we could use the store apps, and Microsoft Intune to uninstall the built-in Windows Store apps. For Windows 11, this seems not possible because of the changes in the Store.To retrieve the name from the Teams client, run below in PowerShell: Get-AppxPackage -Name teams * With the remediation script, we remove the Teams app. This can be done by running: Get-AppxPackage -Name MicrosoftTeams | Remove-AppxPackage -ErrorAction stop With this information, we can create two simple scripts to get the job done. This is our detection script: #Script detects the new Microsoft Teams consumer app on Windows 11.

    if ($null -eq (Get-AppxPackage -Name MicrosoftTeams)) {

    Write-Host "Microsoft Teams client not found"
    
    exit 0
    

    } Else {

    Write-Host "Microsoft Teams client found"
    
    Exit 1
    

    } And this is our remediation script:#Script removes the new Microsoft Teams consumer app on Windows 11.

    #App is removed because this app can only be used with personal Microsoft accounts

    try{

    Get-AppxPackage -Name MicrosoftTeams | Remove-AppxPackage -ErrorAction stop
    
    Write-Host "Microsoft Teams app successfully removed"
    

    }

    catch{

    Write-Error "Errorremoving Microsoft Teams app"
    

    } Let’s implement the proactive remediation.

    Sign in to the Microsoft Endpoint Manager admin center

    Browse to Reports – Endpoint Analytics – Proactive remediations

    Click +Create script package

    Enter a Name and Description (optional)

    Click Next

    Upload the Detection and Remediation script

    Set Run this script using logged-on credentials to Yes

    Set Run script in 64-bit PowerShell to Yes

    Click Next We can assign the remediation for example to All devices and use a filter to only run the scripts on Windows 11 devices.When we click on Daily (under schedule) we can edit the schedule based on which the script is run.The remediation script is scheduled and will remove the Teams app on a daily base.

    1 person found this answer helpful.

  2. Simon Ren-MSFT 40,341 Reputation points Microsoft External Staff
    2024-01-29T09:47:49.04+00:00

    Hi @TechUST ,

    Thank you for posting in Microsoft Q&A forum.

    Similar thread for your reference:

    Issue with Intune Script: Successful Report, but Ineffective Removal of Personal Teams on Windows 11 Devices

    Thanks for your time. Have a nice day!

    Best regards,

    Simon


    If the response is helpful, please click "Accept Answer" and upvote it. Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.