Commands › Microsoft Teams

New-CsInboundBlockedNumberPattern

Microsoft Teams MicrosoftTeams New-*

Adds a blocked number pattern to the tenant list.

Quick start script

# New-CsInboundBlockedNumberPattern — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-MicrosoftTeams -CertificateThumbprint $thumb -ApplicationId $appId -TenantId $tenantId

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-CsInboundBlockedNumberPattern
$before | Format-List

# 3. Make the change (dry run first)
New-CsInboundBlockedNumberPattern -Identity <String> -Name <String> -Pattern <String> -WhatIf
New-CsInboundBlockedNumberPattern -Identity <String> -Name <String> -Pattern <String>

# 4. Verify and diff
$after = Get-CsInboundBlockedNumberPattern
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax — 2 parameter sets

Identity (Default)

New-CsInboundBlockedNumberPattern [-Identity] <string> -Pattern <string> [-ResourceAccount <guid>] [-Description <string>] [-Enabled <boolean>]
 [-WhatIf] [-Confirm] [<CommonParameters>]

ParentAndRelativeKey

New-CsInboundBlockedNumberPattern -Pattern <string> -Name <string> [-ResourceAccount <guid>] [-Description <string>] [-Enabled <boolean>]
 [-WhatIf] [-Confirm] [<CommonParameters>]

Parameters (8)

ParameterTypeRequiredWhat it controls
-Confirm SwitchParameter Prompts you for confirmation before running the cmdlet.
-Description String A friendly description for the blocked number pattern to be created.
-Enabled Boolean If this parameter is set to True, the inbound calls matching the pattern will be blocked.
-Identity String yes A unique identifier specifying the blocked number pattern to be created.
-Name String yes A displayable name describing the blocked number pattern to be created.
-Pattern String yes A regular expression that the calling number must match in order to be blocked.
-ResourceAccount Guid The GUID of a resource account to redirect calls to when the pattern matches. If specified, matched calls will be redirected to this resource account instead of being blocked.
-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.