One Liner: Check if a PSTN number is blocked in Skype Online or Teams

Recently added to Skype Online and Teams is the ability to block inbound calls based on their caller ID. Useful for blocking nuisance callers. Once you’ve added the patterns, you ideally want to know:

  • If the calling numbers you want to block will be caught in your patterns. Regex is not my strong suit so want to make sure it will match.
  • Are some calls going to be inadvertently blocked? If you have many rules it might not be apparent which pattern(s) are blocking it.

I’ve set up a pattern called test to demonstrate this. The pattern will match +441234567890 or 441234567890:

By running the following command you can quickly see what enabled patterns match (if any):

Get-CsInboundBlockedNumberPattern | Where-Object {"<tel number>" -match $_.Pattern -and $_.Enabled -eq $True}

To demonstrate I’ve run the command three times, one with +441234567890, then with 441234567890 and finally the same number with the last digit missing - 44123456789:

As you can see the first two match the pattern and the third correctly does not.

Hope this helps.