Powershell Teams - block Phone Number

PHOTO EMBED

Thu Oct 12 2023 06:27:05 GMT+0000 (Coordinated Universal Time)

Saved by @JasonB

Install-Module -Name MicrosoftTeams -RequiredVersion 5.6.0

New-CsInboundBlockedNumberPattern -Name "BlockNumber0416450519" -Enabled $True -Description "BlockAgent2" -Pattern "^\+?0416450519$"


confirm blocked numbers added with this command Get-CsInboundBlockedNumberPattern



PS C:\Windows\system32> Get-CsInboundBlockedNumberPattern

 

 

Identity    : BlockNumber0491842223
Name        : BlockNumber0491842223
Enabled     : True
Description : BlockAgent1
Pattern     : ^\+?0491842223$

 

Identity    : BlockNumber0416450519
Name        : BlockNumber0416450519
Enabled     : True
Description : BlockAgent2
Pattern     : ^\+?0416450519$
content_copyCOPY

https://learn.microsoft.com/en-us/microsoftteams/block-inbound-calls