Commands › Microsoft Teams

Set-CsPhoneNumberAssignmentBlock

Microsoft Teams MicrosoftTeams Set-*

This cmdlet allows the admin to create and assign a temporary block on telephone number assignment to selected telephone number.

Quick start script

# Set-CsPhoneNumberAssignmentBlock — 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-CsPhoneNumberAssignmentBlock
$before | Format-List

# 3. Make the change
Set-CsPhoneNumberAssignmentBlock -TelephoneNumber <String>

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

Syntax

Set-CsPhoneNumberAssignmentBlock -TelephoneNumber <String> [-AssignmentBlockedForever] [-AssignmentBlockedDays <Integer>] [<CommonParameters>]

Parameters (3)

ParameterTypeRequiredWhat it controls
-TelephoneNumber String yes Indicates the phone number for the assignment block to be assigned.
-AssignmentBlockedForever SwitchParameter Sets an indefinite block on assignment for the telephone number.
-AssignmentBlockedDays Int32 Sets a duration based assignment block on the telephone number.

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