Update! I got some feedback on this blog. Seems that if your users are not members of the local administrator group, install will faill with error: 0x80070001. I've updated the article to solve this problem. I replaced the cmd files for Powershell scripts and did some minor changes to the detection and uninstall scripts. This should now work for users without admin permissions.
Microsoft introduced background effects in Teams. All of a sudden you see people having their custom backgrounds. You might wonder how this trick is done because there is no button to upload your own image (yet).
When you start using the default backgrounds during meetings, a folder is created in %AppData%\Microsoft\Teams called Backgrounds. Within that folder, you’ll find another folder called Uploads. When you drop an image into that folder, you can pick that image and use it as your custom background image during your Teams meeting.
For an avarage user, this is not convenient to do. You might want to do it for them. In this blogpost I’ll show you how to push a custom background image to your Windows 10 devices using Intune. I’ll use a Win32 application.
Update 04-06-2020: Teams now has an upload button, so it’s easier for users to upload their own images.
A warning up front. This might no be the best way to do this. This is just a way to do it.
What do we need?
- A custom background image file
- Few lines PowerShell to install the files
- Powershell script for custom detection script (optional)
- The Microsoft Win32 Content Prep Tool
Background image file
Pick a nice image (JPEG or PNG) that you want your users to use. In my demo, I use a free stock image with my “company logo”. The default images in Teams are 1920 x 1080 pixels, so I’ll stick to that. Optional, you can use https://tinypng.com/ to shrink them to a proper size. This is my source image:
Install and uninstall script
Next, we are going to create the install file for the Win32 app. Open up your favorite PowerShell editor and copy-paste the following code. Adjust the filename of the image to match yours.
#set upload folder
$UploadFolder="$env:APPDATA\Microsoft\Teams\Backgrounds\Uploads"
# create folder if not exists
if(!(Test-Path -path $UploadFolder))
{
New-Item -ItemType directory -Path $UploadFolder
Write-Host "Folder has been created successfully"
}
else
{
Write-Host "The folder already exists";
}
#copy all (image) files to the upload folder
Copy-Item -path '.\images' -Filter *.* -Destination $UploadFolder -Recurse -Container:$false
For the uninstall script, we simply use this line:
#set upload folder
$UploadFolder="$env:APPDATA\Microsoft\Teams\Backgrounds\Uploads"
#delete JPG
Remove-Item -Path $UploadFolder\*.jpg -Force
Note: the uninstall script will delete all JPG files from the upload folder. You can add specific files or filetypes to be deleted.
Save both files as .ps1 files and put them into a folder on your local hard drive. Also, make an empty folder for your output file. Create a new folder ‘images’ and drop your background files in the folder. The script will copy all the files from that folder into the Teams upload folder.
The Microsoft Win32 Content Prep Tool
Grab the Microsoft Win32 Content Prep Tool from Github and start the tool. Enter the source folder, the setup file, and the output folder. When ready, you find the Intunewin file in the output folder. We need this file for our next step.
Detection script
I created a simple detection script. We need this in the next step. Create a .ps1 file with the follwing content:
if (Test-Path "$env:APPDATA\Microsoft\Teams\Backgrounds\Uploads\*.jpg") {
Write-Host "File detected"
}
Note: if you use other extensions, make sure you replace the \*.jpg with your extension.
Win32 app
Next, we are going to create the Win32 app in Intune. Go to the Microsoft Endpoint Manager Admin Center and create a new Win32 app.
Install command: powershell.exe -executionpolicy Bypass .\install.ps1
Uninstall command: powershell.exe -executionpolicy Bypass .\uninstall.ps1
Let’s see if it works!
Head over to your device. You’ll see the application being installed, and the custom image is created in the Teams appdata folder.
Uninstall
If you want your custom image deleted, just uninstall the Win32 application. Attach the group of devices in the uninstall section and make sure the mode is set to included.
Wrap things up
I guess Microsoft is releasing a better way for the Teams users to manage their own custom background images. For now this will do the trick. You can push a company managed image, and instruct your user to use it in meetings.
This is also an example of whats is possible using Win32 apps and files. Happy deploying!
Sources used:
M365 Environment 11 – Copy Files (Win32 App)
Is there a way to upload multiple images in the script?
Hi Dan, sure!
You can either duplicate the copy line and replace the image filename:
copy /Y .\CustomCompanyBackground1.jpg %UploadFolder%
copy /Y .\CustomCompanyBackground2.jpg %UploadFolder%
copy /Y .\CustomCompanyBackground3.jpg %UploadFolder%
copy /Y .\CustomCompanyBackground4.jpg %UploadFolder%
Or replace the line copy /Y .\CustomCompanyBackground.jpg %UploadFolder% by copy /Y .\*.jpg %UploadFolder%
This will copy all image files (with .jpg extension in this case) to the Teams upload folder
I have updated the article to just put all images in one folder. Check it out.
Jan, very cool! We followed each step exactly, and deployed to a 365 Group containing 26 users; 8 failed to install with 0x80070001 “unknown” errors. Any idea what I should be looking for in the client-side logs, or the Intune collect/download logs to figure out what it didn’t work for everyone?
Hi Niv, do the failed installs have 1 single Windows version in common? Take a look a this blog for troubleshooting Win32 apps: https://oliverkieselbach.com/2018/10/02/part-3-deep-dive-microsoft-intune-management-extension-win32-apps/
Hi, I have the same issue and can’t figure out why it wont work. I have two test clients, both running the 1909, not local admin and both are failing with this error. I can’t find anything in the logs that explains the issue – any ideas?
I have updated the article to solve this problem. Let me know if it works!
We’ve noticed the failures are on devices where the user isn’t a local admin. I’ll try the updated script(s) and let you know!
I have updated the article to solve this problem. Let me know if it works!
Hi Jan,
Thanks so much for this article.
I am unable to see background folder under “%AppData%\Microsoft\Teams” folder, will it create during joining teams meeting or something missed here.
If I want to use GPO for this setting , will it help.
Hi Deveandra, do you have a Teams per-user or per-machine installation? Check this docs for more info: https://docs.microsoft.com/en-us/microsoftteams/msi-deployment
Hi Jan,
Not sure but this is pushed through SCCM and it might be per machine base installation.
To fix this can you please help me here.
Hi Jan,
One observation here when I joined teams meeting and click on “Show background effects” option there will show few background image and under “%AppData%\Microsoft\Teams” it will create background\upload folder as well but without click on “show background effects” how “background\upload” folder will show on end users machines.
Is there any automation.
Thanks in Advance for help me here.
Hi Devendra, if the background folder itself is missing, I assume that your version needs to be updated. When you never used background images, the Upload folder is not shown, that’s what I saw too. My script is taking care of that. The background folder itself should already be there. What version do you use? This was my version the moment I was able to see backgrounds: 1.3.00.8663. Today, I’m on 1.3.00.12058
Hi Folks is there a way to set my custom background as default ? I don’t want to choose the uploaded picture from the list everytime.
Thank you in advance.
This is something I could not figure out yet, but is highly requested. I hope this is released soon.
Hi Jan,
We also tried to deploy it this way and found out that alsmost all users had the “0x80070001″error. We found that all users with local admin rights had the backgrounds installed, all user without admin rights didn’t.
Hi guys, any update on the 0x80070001 local admin error, has anyone figured out a solution?
I have updated the article to solve this problem. Let me know if it works!
I have updated the article to solve this problem. Let me know if it works!
Thanks Jan. I am using the updated article and I am getting the same errors as everyone else expressed. Can you share the details how it was fixed, perhaps I am missing something.
Thanks for sharing such a nice article.
By the way, I am running the script shared on 6/2/2020 and it only runs on computers where the user is admin. It is not working on other computers.
Hi Carlos, I suggest you create a whole new Win32 app and follow the article from the start with the new scripts. Let me know of if you need any help after that.
I have tried this script , but only working for me and failed for other users .
i am suspecting because source file and images is stored on my local machine
Copy-Item -path ‘C:\Users\ikamboj\OneDrive……\images’ -Filter *.* -Destination $UploadFolder -Recurse -Container:$false
please suggest
Also looking for info’s about 0x80070001.
I have updated the article to solve this problem. Let me know if it works!
Now it works. Thanks. I use a variant of the powershell script to set the user’s deskop background to a corporate image.
That’s good to hear Thilo!
Thilo, would you mind sharing your variant of the powerhsell scripts?
Thanks
Oddly would to grab a copy of this also. Was going to sit down and write it now…
Any ideas on using InTune to push Teams backgrounds to managed MacOS devices?
Mhhm, not done that before. Seems that you’ll need an Apple Developer to sign the package and than wrap it with Intune App Wrapping Tool for Mac. https://docs.microsoft.com/en-us/mem/intune/apps/lob-apps-macos
Pingback: Manage the video backgrounds of your users with Intune – 365 admin service
Thanks Jan for providing step by step instructions, how to automate the process so that users won’t be able to change the background and it’s set automatically from intune.
Have not figured that out (yet) 😉 I’ve looked for this, but it seems not possible at the moment. As soon as I figure it out, I’ll update the post!
Good morning
I see that this setting does not block the image, in this case the user can still change.
Is there a possibility of blocking?
HI, I have not found any option to set a mandatory picture for your users. Sorry.
I’ve created the app but the images are not in the upload folder. On our systems, the upload folder path is AppData\Roaming\Microsoft\Teams\Backgrounds\Uploads. The script leaves out the Roaming path. Could this be the issue?
The script is using $env:APPDATA. You can replace this with the hardcoded path as well, or user %appdata% for example. Hope this helps.
Hi Jan, This a great article. Can we use the Azure Blob storage to store the image files and then use the PS to install them ? In this way we can just use the PS and not the Win32 Application.
Yes, that’s possible. Tristan uses this approach in his blog post: https://workplaceascode.com/2020/04/17/distribute-custom-backgrounds-for-teams-via-intune/
Thanks for the post I enjoy reading it continue your good work. we provide a 24 hour emergency IT support service.
If you need us to resolve a frustrating IT issue just call us and you will be working again in no time.
Thanks for this Jan.
I’m getting the error below when specifying Install.ps1 in the setup file. Any ideas?
λ .\IntuneWinAppUtil.exe
Please specify the source folder: TeamsImages
Please specify the setup file: Install.ps1
ERROR The setup file you specified can not be accessed.
Still works great, way better than the 7 page PS-Script one has thrown last year at me. 202 installed perfectly so far, one has thrown 0x80070001 and two 0x8007013A, all Windows 10.0.19044.1766.
90% of my clients got this error: 0x80070001
I’m using exact this scripts.
Thanks for the painful information.
@JAN BAKKER.
Script runs perfectly, thank you.
Just one question. How could I edit the script, the check if the Uploaded png’s are infact in the folder, and if not, to reupload?
Issue is some users might accidently delete the backgrounds, and I want to check if there is a way this script could evaluate?
This has been setup to run to all Devices (and not users)
Probably way too late, but you should change the detection script to the exact filepath for the uploaded PNG and thats it 🙂
If it detects the PNG it wont install, but if it doesnt detect the exact filepath for the uploaded PNG it will force the install again.
Just push out the script to “All devices”.