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

Microsoft please, please, please, we beg you! Release an ADMX for Microsoft Teams that works! No? Okay, let me show you how I got Microsoft Teams to stop auto-starting.

Published 2021-02-20


Hi, It's been a while since I've posted something here, but I've just figured this thing out after doing some research and there wasn't a lot of information out there. So here we go...

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 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!


AuthorChristopher Talke

TopicsMicrosoft Teams and Windows Server

Find an issue with this post? Think you could clarify, update or add something? All my posts are available to edit on Github!