Commands › Microsoft Teams

Set-CsPhoneNumberPolicyAssignment

Microsoft Teams MicrosoftTeams Set-*

This cmdlet assigns a policy to a specific telephone number in Microsoft Teams.

Quick start script

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

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

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

Syntax

Set-CsPhoneNumberPolicyAssignment [-TelephoneNumber <String>] [-PolicyType <String>] [-PolicyName <String>]
 [<CommonParameters>]

Parameters (3)

ParameterTypeRequiredWhat it controls
-TelephoneNumber String yes Specifies the telephone number to which the policy will be assigned.
-PolicyType String yes Indicates the type of policy being assigned.
-PolicyName String The name of the policy to assign. This must match an existing policy configured in the tenant.

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