At the start of the year, we started getting a windows firewall popup when a user started a call in Microsoft Teams for the first time, and before long customers started complaining about it.

I thought this would be an easy fix, update the firewall rules in group policy and be done with it. I was wrong. As I found out the windows firewall settings can’t handle user-based wildcards such as %localappdata%\Microsoft\Teams\current\Teams.exe.
After a bit of searching, I came across this little powershell script on Microsoft docs. It worked, but I was not sure of the best way to deploy it on mass.
I then found this great MSEndpointMgr community article on how to deploy it via intune, written by @michael_mardahl he also wrote an enhanced version of the script that does some fancy checks and clean up. If we were using intune I would have used his script.
In this article I will show you how to apply the Microsoft Teams firewall script using compliance in MEMCM (Microsoft Endpoint Configuration Manager, formally known as SCCM or ConfigMgr).