# Adds 1 background(s) from https://behindme.onneby.com to Microsoft Teams. # Writes only to Teams' own custom-background folder for the current user. $ErrorActionPreference = 'Stop' $ProgressPreference = 'SilentlyContinue' $backgrounds = @( @{ Guid = 'bf085683-a35f-42c2-a30b-1b474afe953f'; Ext = 'jpg'; Image = 'https://behindme.onneby.com/images/dm1fo17efd.jpg'; Thumb = 'https://behindme.onneby.com/images/dm1fo17efd_thumb.jpg' } ) $targets = @( # New Teams (2023+) @{ App = (Join-Path $env:LOCALAPPDATA 'Packages\MSTeams_8wekyb3d8bbwe'); Dir = (Join-Path $env:LOCALAPPDATA 'Packages\MSTeams_8wekyb3d8bbwe\LocalCache\Microsoft\MSTeams\Backgrounds\Uploads') }, # Classic Teams @{ App = (Join-Path $env:APPDATA 'Microsoft\Teams'); Dir = (Join-Path $env:APPDATA 'Microsoft\Teams\Backgrounds\Uploads') } ) $installed = 0 foreach ($target in $targets) { if (-not (Test-Path $target.App)) { continue } New-Item -ItemType Directory -Force -Path $target.Dir | Out-Null foreach ($bg in $backgrounds) { Invoke-WebRequest -UseBasicParsing -Uri $bg.Image -OutFile (Join-Path $target.Dir "$($bg.Guid).$($bg.Ext)") Invoke-WebRequest -UseBasicParsing -Uri $bg.Thumb -OutFile (Join-Path $target.Dir "$($bg.Guid)_thumb.$($bg.Ext)") } Write-Host "Added $($backgrounds.Count) background(s) to $($target.Dir)" $installed++ } if ($installed -eq 0) { Write-Warning "Couldn't find Microsoft Teams for this user. Download the image instead and use 'Add new' under Backgrounds in a meeting." } else { Write-Host "Done. In Teams, start or join a meeting (Calendar > Meet now works) and open the background effects next to the camera switch. Quit and reopen Teams if they don't show up yet." }