Microsofot Teams disabling GPU hardware acceleration GPO or Registry

Brian Cerveny 66 Reputation points
2022-02-03T16:22:30.85+00:00

Is there a GPO to disable GPU hardware acceleration for Teams machine-wide-installer. I've seen mentions of a JSON file but was looking for a GPO or Reg setting to disable.

I need to deploy via MECM to a few hundred machines.

Microsoft Security | Intune | Configuration Manager | Application
Microsoft Teams | Microsoft Teams for business | Other
0 comments No comments
{count} votes

Accepted answer
  1. Yuki Sun-MSFT 41,376 Reputation points Moderator
    2022-02-04T02:00:32.21+00:00

    Hi @Brian Cerveny ,

    Is there a GPO to disable GPU hardware acceleration for Teams machine-wide-installer. I've seen mentions of a JSON file but was looking for a GPO or Reg setting to disable.

    No. As you stated above, this setting ("disableGpu":true) is a user setting saved in the desktop-config.json file which is by default located at %Appdata%\Microsoft\Teams. so currently there's no GPO or registry setting available to disable GPU hardware acceleration for all users.

    I've seen some similar suggestions submitted in the official feedback portal for Microsoft Teams and have voted them. You can also add your vote or comment there and hopefully this can be noticed and considered by the product team:
    I want to change the GPU hardware accelerator settings at once.
    171194-1.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    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.

    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Brian Cerveny 66 Reputation points
    2022-02-11T13:50:43.937+00:00

    Yes, this script works as is. I've attached the script. You'll have to rename it back to .ps1.

    The only item I added in MECM was a detection method. I have the detection method looking for a file. I placed it in C:\TeamsUpdate\test.txt

    I tried using a PS detection method for a modification to desktop-config.json but MECM would always show a failed install even though the script processed.

    The detection method I've used does work. I've tested it as of 2-10-22. You can change the directory and file that I used in the PS script.

    If you wanted to change the dir and file being created, update this line: New-Item -Path C:\TeamsUpdated -Name "test.txt" -ItemType "file" -Value "UpdateComplete" -Force

    Teams will force close

    173527-sccm-disable-teams-gpu-hardware-acceleration-ps-wo.pdf
    173558-teamsdisablegpudesktopsettings3ps1.txt

    0 comments No comments

  2. Austin P 1 Reputation point
    2022-09-14T22:23:06.55+00:00

    Is it as simple as push down a GPO to run a script with this in it?:

    $dtConfigPartial = '\AppData\Roaming\Microsoft\Teams\desktop-config.json'
    $dtConfigFull = $env:USERPROFILE + $dtConfigPartial

    ((Get-Content -path $dtConfigFull -Raw) -replace '"disableGpu":false','"disableGpu":true') | Set-Content -Path $dtConfigFull

    0 comments No comments

  3. Brian Cerveny 66 Reputation points
    2022-09-15T21:01:17.007+00:00

    Hello,

          I believe I tried using the replace in the JSON file but Teams didn't seem to acknowledge the change. After running a similar command as you have listed and verifying the updated JSON file Teams GPU setting remained unchanged.  Even after a forced-close of Teams and reboot. If you're able to test via a GPO and let me know that would be great. 
    
    0 comments No comments

  4. Brian Cerveny 66 Reputation points
    2022-02-07T23:40:51.963+00:00

    I did find this PowerShell script that works SCCM detection is a challenge but the script still works, deployed as Application to User

    param(

    Define parameters and values

    [string]$newWebLanguage="en-us",
    [bool]$newDisableGpu=$true,
    [string]$desktopConfigFile="$env:userprofile\AppData\Roaming\Microsoft\Teams\desktop-config.json",
    [string]$cookieFile="$env:userprofile\AppData\Roaming\Microsoft\teams\Cookies",
    [string]$registryPath="HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall",
    [string]$registryDisplayName="Microsoft Teams",
    [string]$processName="Teams"
    )

    Check if Teams is installed

    $registryPathCheck = Get-ChildItem -Path $registryPath -Recurse | Get-ItemProperty | Where-Object {$_.DisplayName -eq $registryDisplayName } -ErrorAction SilentlyContinue

    Check if Teams process is running

    Stop-Process -Name Teams -ErrorAction SilentlyContinue

    $processCheck = Get-Process $processName -ErrorAction SilentlyContinue

    Read the Teams desktop config file and convert from JSON

    $config = (Get-Content -Path $desktopConfigFile | ConvertFrom-Json -ErrorAction SilentlyContinue)

    Check if required parameter value is already set within Teams desktop config file

    $configCheck = $config | where {($.currentWebLanguage -ne $newWebLanguage) -or ($.appPreferenceSettings.disableGpu -ne $newDisableGpu)} -ErrorAction SilentlyContinue

    Check if Teams cookie file exists

    $cookieFileCheck = Get-Item -path $cookieFile -ErrorAction SilentlyContinue

    1-If Teams is installed ($registryPathCheck not null)

    2-If Teams desktop config settings current value doesn't match parameter value ($configCheck not null)

    3-If Teams process is running ($processCheck not null)

    4-Then terminate the Teams process and wait 5 seconds

    if ($registryPathCheck -and $configCheck -and $processCheck)
    {
    Get-Process $processName | Stop-Process -Force
    Start-Sleep 5
    }

    Check if Teams process is stopped

    $processCheckFinal = Get-Process $processName -ErrorAction SilentlyContinue

    1-If Teams is installed ($registryPathCheck not null)

    2-If Teams desktop config settings current value doesn't match parameter value ($configCheck not null)

    3-Then update Teams desktop config file with new parameter value

    if ($registryPathCheck -and $configCheck)
    {
    $config.currentWebLanguage=$newWebLanguage
    $config.appPreferenceSettings.disableGpu=$newDisableGpu
    $config | ConvertTo-Json -Compress | Set-Content -Path $desktopConfigFile -Force

    1-If Teams process is stopped ($processCheckFinal is null)

    2-If Teams cookie file exists ($cookieFileCheck not null)

    3-Then delete cookies file

    if (!$processCheckFinal -and $cookieFileCheck)
    {
        Remove-Item -path $cookieFile -Force
    }
    

    }

    1 person found this answer helpful.

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.