Commands › Microsoft Teams

Set-CsTeamsUnassignedNumberTreatment

Microsoft Teams MicrosoftTeams Set-*

Changes a treatment for how calls to an unassigned number range should be routed. The call can be routed to a user, an application or to an announcement service where a custom message will be played to the caller.

Quick start script

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

# 3. Make the change (dry run first)
Set-CsTeamsUnassignedNumberTreatment  -WhatIf
Set-CsTeamsUnassignedNumberTreatment

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

Syntax

Set-CsTeamsUnassignedNumberTreatment [-Description <String>] [[-Identity] <String>] [-Pattern <String>]
 [-Target <String>] [-TargetType <String>] [-TreatmentPriority <Int32>] [-MsftInternalProcessingMode <String>]
 [-WhatIf] [-Confirm] [<CommonParameters>]

Parameters (9)

ParameterTypeRequiredWhat it controls
-Confirm SwitchParameter Prompts you for confirmation before running the cmdlet.
-Description String Free format description of this treatment.
-Identity String The Id of the specific treatment.
-MsftInternalProcessingMode String {{ Fill MsftInternalProcessingMode Description }}
-Pattern String A regular expression that the called number must match in order for the treatment to take effect. It is best practice to start the regular expression with the hat character and end it with the dollar character. You...
-Target String The identity of the destination the call should be routed to. Depending on the TargetType it should either be the ObjectId of the user or application instance/resource account or the AudioFileId of the uploaded audio file.
-TargetType String The type of target used for the treatment. Allowed values are User, ResourceAccount and Announcement.
-TreatmentPriority Int32 The priority of the treatment. Used to distinguish identical patterns. The lower the priority the higher preference. The priority needs to be unique.
-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.