photo 1547068961 aa008634973d

Distribute custom backgrounds for Teams via Intune

Finally, it’s GA the capability to use custom backgrounds during a Microsoft Teams meeting. I’ve found tens of blogs that describe the feature like this at the WindowsClub. I want to share my approach to distribute the custom backgrounds for teams centrally to Intune managed devices.

There are multiple approaches to achieve your goal to place a set of pictures into a specific location. Personally, for me it’s important that the script meets the following requirements;

  • The script is reusable in case the background(s) needs to be updated;
  • End-users can add more backgrounds themselves;
  • The script is usable in a multi-user scenario;

Result

The result is that the script adds all the pictures from the .zip file into any user’s custom background location including the default user. Custom backgrounds must be placed into the folder:

c:\users\%username%\AppData\Roaming\Microsoft\Teams\Backgrounds\Uploads

Custom-MicrosoftTeamsBackground

The script below can be used to push your background. Note replace line 13 with your own zip file which contains all the backgrounds! I recommended using an Azure storage blob as the source location.

<#
.NOTES
===========================================================================
Created with: PowerShell
Created on: 15-04-2020
Created by: Tristan van Onselen
Filename: Add-CustombackgroundsforTeams.ps1
===========================================================================
.DESCRIPTION
This script will add custom backgrounds for Teams
#>
$source = "https://sacomputeranalyzer.blob.core.windows.net/custombackgrounds/photo-1518481852452-9415b262eba4.zip"
Start-BitsTransfer -Source $source -Destination $env:temp
$filename = Split-Path -Path $source -Leaf
if(test-path -Path $env:temp\CustomBackgrounds)
{
remove-item $env:temp\CustomBackgrounds -Recurse -Force
}
Expand-Archive -LiteralPath $env:TEMP\$filename -DestinationPath "$env:temp\CustomBackgrounds" -Force
$AllLocalUsers = (Get-ChildItem -path $env:SystemDrive:\Users).name
$AllLocalUsers += "Default"
foreach($user in $AllLocalUsers)
{
$destination = ("$env:SystemDrive" + "\users\" + "$user" + "\AppData\Roaming\Microsoft\Teams\Backgrounds\Uploads")
if(!(Test-Path -Path $destination))
{
New-Item -Path "$destination" -ItemType Directory | out-null
}
copy-item -path "$env:temp\CustomBackgrounds\*.*" -Destination $destination -Force
}

How to configure scripts in Intune

Step 1 – 1 ) Open the Intune blade Device Configuration | scripts
Step 1 – 2 ) Add a new script by using the add button followed by Windows 10.

Intune New Script

Step 2 -1 ) Give the name a logical name like Add-CustomBackgroundsForTeams

Intune-Add-script

Step 3 -1 ) Add the script from your local computer
Step 3 -2 ) Select the option run script in 64 bits PowerShell Host (the script includes components who are not present in the 32-bits PowerShell host!).

Intune-Add-script-script

Step 4- 1 ) Assign the script to a user or device group.
Step 4 -1 ) Review the settings and save the configuration

Intune-script-assign-group

Conclusion

As soon as the script is successfully deployed the user can immediately use the custom background. They see the added background by the Microsoft Teams default (custom) backgrounds. The users can add more custom backgrounds if they want.

Teams-Meeting-CustomBackground

Leave a Reply

Your email address will not be published. Required fields are marked *