How to disable Microsoft Teams Auto Start via Group Policy Object (GPO)

Christopher Talke Buscaino

If you've ever pushed out Microsoft Teams to your domain joined machines you might have realized how hungry teams can be during the start-up process, followed by the RAM destruction that ensues when its just sitting idle.

Especially low-end devices, and don't even get me started on Remote Desktop Session Hosts (RDSHs) such as Windows Server 2019 or Windows Virtual Desktop (WVD).

Microsoft Teams Meme

So what do you do?

Do you just turn to the auto-start ADMX?

No you cannot, because it doesn't work as intended. You see... the ADMX Microsoft released only works BEFORE the end-user first launches Microsoft Teams. Once the configuration has been written to the registry and the desktop-config.json there is only one thing left to do.

Turn to trusty ol powershell, lucky us a bloke by the name of Chenry Lee found a workaround, he does not give attribution to the bloke who wrote it but overall once you read the script its pretty straight forward and non-complex (see below).

# Remove Registry Key Prop
$entry = $null -eq (Get-ItemProperty HKCU:\Software\Microsoft\Windows\CurrentVersion\Run)."com.squirrel.Teams.Teams"
if ( !$entry ) {
    Remove-ItemProperty HKCU:\Software\Microsoft\Windows\CurrentVersion\Run -Name "com.squirrel.Teams.Teams"
}

# Modify JSON Configuration File
$Teams_config_file = "$env:APPDATA\Microsoft\Teams\desktop-config.json"
$configs = Get-Content $Teams_config_file -Raw
if ( $configs -match "openAtLogin`":false") {
    break
}
elseif ( $configs -match "openAtLogin`":true" ) {
    $configs = $configs -replace "`"openAtLogin`":true", "`"openAtLogin`":false"
}
else {
    $disable_auto_start = ",`"appPreferenceSettings`":{`"openAtLogin`":false}}"
    $configs = $configs -replace "}$", $disable_auto_start
}
$configs | Set-Content $Teams_config_file

Anyway, give this a try!

Create your logon script group policy, drop that script into a directory that can be accessed by anyone on your domain, link your script to the GPO and save it. Add your WMI filter to your new GPO, link your OUs and enable it.

With any luck this should stop Teams from auto launching on those machines were you just cant have Microsoft Teams eat up resources.

Hope this helps!