Microsoft Teams has evolved, and so have the methods to enhance your virtual meeting experience... kind of 😉
In this instructional and technical guide, I will walk you through the step-by-step process of the process to deploy a custom virtual background for the new version of the Microsoft Teams Client using Intune.
I will use a custom Win32 application for that based on PowerShell.

Table of Contents

Difference between the Classic and the New Teams Client

The main difference between the two clients is how the virtual backgrounds are stored. In the classic client, you could simply drop a PNG or JPG file into the right folder. In the new Teams client, you have to name the file with a GUID and place an additional thumbnail file with the same GUID in the same directory.
The locations are different as well:

Teams Classic

C:\Users\%username%\AppData\Roaming\Microsoft\Teams\Backgrounds\Uploads

New Teams

C:\Users\%username%\AppData\Local\Packages\MSTeams_8wekyb3d8bbwe\LocalCache\Microsoft\MSTeams\Backgrounds\Uploads

Script Explanation and Flow Chart

The script is designed to make the whole process as simple as possible. My goal was that you can just put all your desired wallpaper in one folder, package the package and don't have to worry about anything else.
So, let's break down the script into key components:

  1. Preparing the Environment:
    • The script starts by defining the package name and version for tracking purposes.
    • It sets the local folder path where Microsoft Teams stores custom background images.
    • Reference IDs and background folder are established.
  2. Cleanup of Old Files:
    • The script checks for existing background files (deployed via a previous version of this package) and removes them.
    • Old files are tracked in a CSV file for reference.
  3. Copying and Renaming Backgrounds:
    • Custom background images are copied to the Teams folder and renamed with GUIDs to ensure they are visible to the user in the client.
    • A thumbnail copy is also created for each background.
  4. Updating Reference IDs:
    • The script updates the reference IDs in a CSV file to keep track of the installed backgrounds.
  5. Validation Key:
    • A validation key is created to signify a successful installation.

Flow Chart

Flowchart of the deployment of new Teams backgrounds

Customize and Deploy the Package

Preparing Your Backgrounds

First you can download my template here:

Before the technical stuff, gather custom background images and organize them in the folder labeled "bg." These images will be available to your users to choose from later.

Creating the Intunewin

Once you have your backgrounds in the folder you can create the Intunewin out of the whole package folder (Teams-Backgrounds). For that do this:

  1. Download the current Microsoft Win32 Content Prep Tool.
  2. Open the downloaded "IntuneWinAppUtil.exe"
  3. Provide the path to your package folder.
  4. Enter the installation file: install.ps1
  5. Enter the path where you want the .intunewin file to be stored.
  6. For the Catalog Folder question, we choose No (N).
  7. Done, now your ready to upload the package to Intune.
Create intunewin for virtual Teams backgrounds

Deploying with Intune

With your intunewin package ready, deploy it using Microsoft Intune. Follow these steps:

  1. Login to Intune
  2. Navigate to: Apps > Windows
  3. Click +Add
  4. Choose: Windows app (Win32)
  5. Upload the install.intunewin
  6. Fill out at the App information:
    • Name: Teams virtual Backgrounds
    • Description: Adds the companies virtual backgrounds to each users profile.
    • Publisher: Your Company name
    • Logo: Teams-virtual-backgrounds.png or your own
  7. The Install and Uninstall command is:
    • %SystemRoot%\sysnative\WindowsPowerShell\v1.0\powershell.exe -windowstyle hidden -executionpolicy bypass -command .\install.ps1
    • %SystemRoot%\sysnative\WindowsPowerShell\v1.0\powershell.exe -windowstyle hidden -executionpolicy bypass -command .\uninstall.ps1
  8. Install behavior: user
  9. In the Requirements choose:
    Operating system architecture: 64-bit
    Minimum OS: what suites you, if you don't have special requirements choose 2004
  10. In the Detection rules choose "Manually configure detection rules" and set it to this registry key:
    • Key path: HKEY_CURRENT_USER\Software\scloud\Teams-new-Backgrounds
    • Value name: Version
    • Detection method: String comparison
    • Operator: Equals
    • Value: 1
  11. You can skip the next three steps DependenciesSupersedence and Scope tags
  12. In the Assignments add your desired groups and your good to go.
App Information for virtual Teams background
App information
Program details for virtual Teams background
Program installation
Teams virtual background detection rule
Detection rule

Testing and Troubleshooting

Before full deployment, test your setup in a controlled environment. If you have errors during the installation or don't get the desired result check the log which i write to the IntuneManagmentExtentions Logs:

C:\ProgramData\Microsoft\IntuneManagementExtension\Logs\Teams-new-Backgrounds-%username%-install.log

Since it's a user based installation you might see multiple logs, each one is for one particular user on the device.

Update Your virtual Backgrounds

If you decide to update your virtual Teams backgrounds, just create a new package like I showed you in this guide. The only thing you need to change is the version Number in the install.ps1 and in the detection rule in your Intune configuration:

installation routine, version increase
Version increase in install.ps1
Intune detection rule, version increase
Version increase for the detection rule

After the version increases in your install.ps1 remember to recreate the intunewin and upload it in the existing Win32 app in Intune.

Conclusion

With this step-by-step guide, you've successfully branded Microsoft Teams for your users. The enhanced virtual background experience not only adds a technical touch but also fosters a sense of connection among team members. A more costly alternative for the deployment of Teams virtual backgrounds would be Teams Premium which would work without Intune.