Teams Client – PowerShell and Group Policy

There’s no great ADMX or ADM file for Teams Group Policy Object or GPO settings. Beyond that, a lot of the user level Teams settings aren’t available in the Teams Admin settings either. But we still may need to push settings organization-wide, for example we may want to disable GPU Hardware Acceleration for everyone to help ease the burned on workstations or VDI. This article covers individual PowerShell commands to change a handful of user-level settings by manipulating the desktop-config.json. We do this with single line commands of Powershell, which can also be pushed through a GPO by adding them to HKCU\Software\Microsoft\Windows\CurrentVersion\Run. We’ll detail a few here, you can then use this as a template to flip other settings as well.

Disable GPU hardware acceleration

This one is the most common I see, so we’ll put it up front. GPU hardware acceleration can help or hinder performance, so we may want to toggle it on or off. By default, it’s turned on. To turn it off, we’ll want to edit the %appdata%\Microsoft\Teams\desktop-config.json file (which is unique to each user account as it’s stored in the profile). In this file there’s a setting called disableGPU, this is set to false by default but we may want to flip it to true.

Running this PowerShell command as the user will flip that switch for you from off to on. If you want to take it from on to off just flip the true and false in the below command. However the change will not be seen until you restart Teams (I’ve actually seen Teams need to restart twice for it to take effect before).

((Get-Content -path $env:APPDATA\Microsoft\Teams\desktop-config.json -Raw) -replace '"disableGpu":false','"disableGpu":true') | Set-Content -Path $env:APPDATA\Microsoft\Teams\desktop-config.json

If you have a login script that runs in PowerShell you can toss that in there. If you have a batch file, or want to run this inside of a GPO, you can put the following command in a batch file or in HKCU\Software\Microsoft\Windows\CurrentVersion\Run.

powershell -command "((Get-Content -path $env:APPDATA\Microsoft\Teams\desktop-config.json -Raw) -replace '\"disableGpu\":false','\"disableGpu\":true') | Set-Content -Path $env:APPDATA\Microsoft\Teams\desktop-config.json"

Auto-start application

I won’t go through the trouble of repeating myself, but instead I’ll just place the commands here for disabling auto-start. If you’re unsure of what I’m doing please read the above GPU section.

((Get-Content -path $env:APPDATA\Microsoft\Teams\desktop-config.json -Raw) -replace '"openAtLogin":true','"openAtLogin":false') | Set-Content -Path $env:APPDATA\Microsoft\Teams\desktop-config.json

For placement in HKCU\Software\Microsoft\Windows\CurrentVersion\Run:

powershell -command "((Get-Content -path $env:APPDATA\Microsoft\Teams\desktop-config.json -Raw) -replace '\"openAtLogin\":true','\"openAtLogin\":false') | Set-Content -Path $env:APPDATA\Microsoft\Teams\desktop-config.json"

Register Teams as the default chat app for Office

((Get-Content -path $env:APPDATA\Microsoft\Teams\desktop-config.json -Raw) -replace '"registerAsIMProvider":false','"registerAsIMProvider":true') | Set-Content -Path $env:APPDATA\Microsoft\Teams\desktop-config.json

For placement in HKCU\Software\Microsoft\Windows\CurrentVersion\Run:

powershell -command "((Get-Content -path $env:APPDATA\Microsoft\Teams\desktop-config.json -Raw) -replace '\"registerAsIMProvider\":false','\"registerAsIMProvider\":true') | Set-Content -Path $env:APPDATA\Microsoft\Teams\desktop-config.json"

Finally, On close, keep the application running

((Get-Content -path $env:APPDATA\Microsoft\Teams\desktop-config.json -Raw) -replace '"runningOnClose":true','"runningOnClose":false') | Set-Content -Path $env:APPDATA\Microsoft\Teams\desktop-config.json

For placement in HKCU\Software\Microsoft\Windows\CurrentVersion\Run:

powershell -command "((Get-Content -path $env:APPDATA\Microsoft\Teams\desktop-config.json -Raw) -replace '\"runningOnClose\":true','\"runningOnClose\":false') | Set-Content -Path $env:APPDATA\Microsoft\Teams\desktop-config.json"