Commands › Microsoft Teams
Test-CsInboundBlockedNumberPattern
This cmdlet tests the given number against the created (by using New-CsInboundBlockedNumberPattern cmdlet) blocked numbers pattern. Cmdlet will return an object with two properties: - IsMatch: True if the given number matches any of the blocked number patterns, otherwise False - ResourceAccount: If the matched blocked number pattern has a ResourceAccount assigned, it will return the ResourceAccount Guid, otherwise null.
Quick start script
# Test-CsInboundBlockedNumberPattern — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-MicrosoftTeams -CertificateThumbprint $thumb -ApplicationId $appId -TenantId $tenantId
# 2. Run and inspect
Test-CsInboundBlockedNumberPattern -PhoneNumber <String> | Format-List
# 3. Export for evidence / drift tracking
Test-CsInboundBlockedNumberPattern | Export-Clixml .\CsInboundBlockedNumberPattern-$(Get-Date -Format yyyyMMdd).xml
Syntax
Test-CsInboundBlockedNumberPattern -PhoneNumber <String> [-TenantId <Guid>] [-WhatIf]
[-Confirm] [<CommonParameters>]
Parameters (4)
Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.