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):

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.


3 thoughts on “One Liner: Check if a PSTN number is blocked in Skype Online or Teams

  • 23rd August 2018 at 6:05 PM

    Do you have any access to docs for these cmdlets? Every link I’m finding is dead; the cmdlet is live/functional on our tenant, but can’t get it to act on any policy despite verifying the CID string hits per your check above. At this point just trying to block a single US number.

    • 23rd August 2018 at 9:10 PM

      Hi JK,

      So MS were a little quick on publishing the documentation. They’ve subsequently pulled the documentation but left the cmd-lets in. In my testing I found it worked with Direct Routing but not calling plans or hybrid (CCE). See this thread:

      Hope this helps!


      • 23rd August 2018 at 9:49 PM

        That does help (sort of). We’re a Calling Plans customer, and I’m having zero luck with it actually working, so that meshes with your findings. Disappointing, as I did see a Documentation Git link back to the Calling Plans page, so I’ll just leave the rules in place and hope they eventually work. Thanks for saving parts of my sanity!


Leave a Reply