Automating Teams Meeting Background Deployment
Last week, I saw a new blog article from Tom Arbuthnot [Tom Talks] discussing the planned roll-out of a new feature that allows organizational control of custom meeting backgrounds from the Teams admin console.
That is a cool feature but the feature will require an Advanced Communication License for every user. Some organizations will happily pay the licensing up-tick until the license is included in an Microsoft 365 Enterprise E5 license. Most of us are not that lucky.
I performed a roll out of organisation backgrounds last year when the custom background feature first appeared. I used the undocumented feature of copying background files in JPG format to the \AppData\Roaming\Microsoft\Teams\Backgrounds\Uploads folder in the user profile. It is a method that works and I used that method successfully with a few thousand devices.
Following some discussion on Twitter last week, I decided to clean-up and re-package the code that I used for wider use. You can find the code in my GitHub public repo [LINK].
There are a few variations of scripts that deploy Teams Backgrounds. However my version has a few enhancements that improve deployment reliability and allow easy long term maintenance of background images. Do your research and pick a script that works for your organisation or use the examples and write your own.
Deployment Package
The code is a WIX MSI package. The image below shows the structure of the WIX MSI package before the package was made into an MSI. You can download these files from my GitHub repo.
The package contains the following.
A bootstrap PowerShell that runs when the MSI package is installed
An images folder where the Teams background images are stored
A scripts folder that contains a PowerShell script to copy the files to the Teams background folder for each logged in user
A config file that controls the execution of the bootstrap and background copy scripts
Bootstrap
The TeamsBootstrap.ps1 PowerShell script runs when the MSI file is installed. The main job of the bootstrap is to create a scheduled task that performs the copy to the logged in user profile.
Scheduled Task
The scheduled task runs a vbscript, which launches the Update-TeamsBackgrounds.PS1 PowerShell script. The VBScript is a workaround that avoids a PowerShell window flashing up when the scheduled task runs in the User context.
The PowerShell script performs the following actions.
Loads the config file
Reads the list of backgrounds
Either adds or removes the backgrounds from the \AppData\Roaming\Microsoft\Teams\Backgrounds\Uploads folder depending on the settings in the config file
Creating the Package
You can create the package by carrying out the following actions.
1) Install the WIX Toolset [LINK]
2) Copy the background image files to the images folder
3) Update the config.xml file to include the names of the image files
4) Increment the version number in the product.wxs file (important if your are updating an MSI rather than performing a new deployment)
5) Run make.cmd from the command line
6) The MSI file will be added to the \Bin\Debug folder
Deployment
You can deploy the MSI file from any management platform. The MSI file will not be signed with a code signing certificate so you may want to consider code signing the MSI depending on your environment.
Note - Deployment via Microsoft Endpoint Manager does not require code signing.
After installation, you will see an installation folder in C:\Program Files\Deploy\TeamsBackgrounds
The Teams client may require a restart before the backgrounds appear in the background picker.