Commands › Microsoft Teams

Test-CsInboundBlockedNumberPattern

Microsoft Teams MicrosoftTeams Test-*

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)

ParameterTypeRequiredWhat it controls
-Confirm SwitchParameter Prompts you for confirmation before running the cmdlet.
-PhoneNumber String yes The phone number to be tested.
-TenantId Guid This parameter is reserved for internal Microsoft use.
-WhatIf SwitchParameter Shows what would happen if the cmdlet runs. The cmdlet is not run.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.