• Eric Marsi

Blocking those Pesky Spam Callers in Microsoft Teams & Skype for Business



You know its going to happen, but its just a matter of when; receiving a spam call. While most spam calls typically involve the caller masking their number (and changing it each time), there is a chance that you may have someone targeting your line directly. This can be quite interruptive especially while you are in your flow. Thankfully there is built-in functionality in Microsoft Teams that allows this to be done at the user or at an organizational level. For users in Skype for Business, things are a bit different, but still very straightforward.


This guide will cover 3 different options that allows one to block the caller's DID from the Microsoft Teams side and the SBC side of the environment (Dependent on your topology):

  • Blocking the caller(s) at the user level (Teams Only)

  • Blocking the caller(s) at the Organization's M365 Tenant (Teams Only)

  • Blocking the caller(s) at the Organization's SBC (Teams Direct Routing or SFB Server Only!)

Option 1: Blocking the caller(s) at the User Level (Teams Only)

For calls that affect individual users, an option that may be explored is blocking the caller in the Microsoft Teams Client. (For Skype for Business users, this must be done via Option 3 below as there is no way to block callers within the client)


  1. Open the Microsoft Teams Client on your PC and navigate to the Calls Tab

  2. Once in the Calls tab, find the caller that you wish to block, click the 3 dots and then click Block

  • The caller will now have a tag in the Microsoft Teams Client as "Blocked", is blocked from calling that user, but is free to call any other users in the organization.


NOTE: This can also be done from the Microsoft Teams Mobile App by clicking into the callers contact card, but cannot be done from a Microsoft Teams Phone as of writing this!


Option 2: Blocking the caller(s) at the Organization's M365 Tenant (Teams Only)

For callers that may be bothering multiple users, preventing them from calling the entire organization may be needed. Please note that before doing this method that you verify that the caller is not masking their number. Unfortunately the ability to block caller(s) at the organization-level is not available in the Microsoft Teams Admin Center and is only available via the Microsoft Teams PowerShell Module. (The Skype for Business PowerShell Module is now deprecated and its commands are rolled into the Teams PS Module)


First, you must setup the Microsoft Teams PowerShell Module. Please follow my guide by CLICKING HERE.


Once that is complete, follow the below steps to block the caller at the organization's M365 tenant:

  1. Connect to Microsoft Teams & Skype for Business Online's PowerShell using the commands located in my other guide by CLICKING HERE

  2. Verify that the number is not blocked already by an existing number pattern in SFB Online with the following cmdlet: Get-CsInboundBlockedNumberPattern

  3. Three options are now available with the following commands; blocking a single number, blocking a sequential number range, or by blocking multiple separate numbers with a RegEx pattern by running one of the below commands:

1 - Blocking a Single Number:


New-CsInboundBlockedNumberPattern -Name “Block Spammer 1” -Enabled $True -Description “Blocks Contoso Electronics from calling us” -Pattern “^[+]?13305551001”


This blocks a single caller at +13305551001

2 - Blocking a Sequential Number Range with RegEx:


New-CsInboundBlockedNumberPattern -Name “Block Spammer 2” -Enabled $True -Description “Blocks Contoso Electronics from calling us” -Pattern “^[+]?(1330555100[3-5])”


This blocks three callers from +13305551003, +13305551004, and +13305551005

3 - Blocking Multiple Separate Numbers with RegEx:


New-CsInboundBlockedNumberPattern -Name “Block Spammer 3” -Enabled $True -Description “Blocks Contoso Electronics from calling us” -Pattern “^[+]?(13305551006|13305551009)”


This blocks a caller at +13305551006 and an caller at +13305551009


These are just three different examples. Feel free to RegEx your dreams :) Note that the number(s) may not be blocked for some time due to Microsoft Teams Backend's Provisioning speed.

Removing a Blocked Caller


You may run into a scenario where you need to remove previously added blocked number(s). To do this, we will remove the "Block Spammer 3" Identity we added earlier:


Remove-CsInboundBlockedNumberPattern -Identity "Block Spammer 3"


Verify the removal with the Get-CsInboundBlockedNumberPattern cmdlet


Option 3: Blocking the caller(s) at the Organization's SBC (Teams Direct Routing or SFB Server Only!)

Below are tutorials to block callers with various different Session Border Controllers (SBCs). One major benefit of blocking callers at the SBC level is that it blocks the callers on all platforms that your organization may have.


AudioCodes SBCs - CLICK HERE


AnyNode SBCs - CLICK HERE

Special Thanks to @marypcbuk on Twitter for this blog post idea!

874 views0 comments