Disable auto start New Teams - logo

Disable Auto Start New Teams in Intune

 

22-02-2024

Microsoft Teams is deployed with Office and gets installed at the next login of the user. At every next logon Teams is started automatically. For some of us this is exactly what we want, but not when it is barely used and especially when using weak hardware; Teams likes to use quite a lot of resources and significantly slows down the computer at start-up.
Unfortunately Intune only has a configuration policy setting to disable Teams auto start for when its has not already been installed. Meaning it does not prevent auto start of Teams when it was already installed.
 
How to Disable Auto Start for Classic Teams with Intune:

In the past, disabling auto start for Classic Teams was a straightforward process. It involved removing the registry key com.squirrel.Teams.Teams from the well-known HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run. The PowerShell script below accomplishes this task:

Get-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run  | Remove-ItemProperty -Name com.squirrel.Teams.Teams -ErrorAction SilentlyContinue

However, the same approach does not apply to the new Teams experience. After careful analysis of the new Teams’ behaviour, a solution was found.

 

How to Disable Auto start for New Teams using Intune:

To disable the auto start for the new Teams, the value of the ‘State’ key in the registry needs to change from 2 to 0. The PowerShell script below achieves this:

# Modify State Key
$rpath = "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\SystemAppData\MSTeams_8wekyb3d8bbwe\TeamsTfwStartupTask"
if (Test-Path $rpath) {
    # Modify State
    Set-ItemProperty -Path $rpath -Name "State" -Value "0"
    # Modify LastDisabledTime
    $epoch = (Get-Date -Date ((Get-Date).DateTime) -UFormat %s)
    Set-ItemProperty -Path $rpath -Name "LastDisabledTime" -Value $epoch
    Write-Host "Autostart NEW Teams has been Disabled"
} else {
    Write-Host "NEW Teams is not found"
}

A combined script for both Classic- as well as the New Teams is available on the GitHub channel. The script including a detection script should be executed in the user context and can be deployed as:

  1. A one-time device configuration script
  2. An .intunewin wrapped Win32 app
  3. A remediation script
Options 2 and 3 are perfect when there is a need to reapply the settings in case the user enables it manually. While option 1 is good for setting the default state where the user can enable it again when needed.