Commands › Microsoft Teams
Set-CsPhoneNumberAssignment
Assigns a phone number to a user or a resource account (online application instance).
Quick start script
# Set-CsPhoneNumberAssignment — 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-CsPhoneNumberAssignment
$before | Format-List
# 3. Make the change
Set-CsPhoneNumberAssignment -EnterpriseVoiceEnabled <Boolean> -Identity <String> -LocationId <String>
# 4. Verify and diff
$after = Get-CsPhoneNumberAssignment
Compare-Object ($before | Out-String) ($after | Out-String)
Syntax — 5 parameter sets
LocationUpdate (Default)
Set-CsPhoneNumberAssignment -TelephoneNumber <String> -LocationId <String> [-HttpPipelinePrepend <SendAsyncStep[]>]
[<CommonParameters>]
NetworkSiteUpdate
Set-CsPhoneNumberAssignment -TelephoneNumber <String> [-HttpPipelinePrepend <SendAsyncStep[]>]
-NetworkSiteId <String> [<CommonParameters>]
ReverseNumberLookupUpdate
Set-CsPhoneNumberAssignment -TelephoneNumber <String> [-HttpPipelinePrepend <SendAsyncStep[]>]
-ReverseNumberLookup <String> [<CommonParameters>]
Assignment
Set-CsPhoneNumberAssignment -TelephoneNumber <String> [-LocationId <String>]
[-HttpPipelinePrepend <SendAsyncStep[]>] -Identity <String> -NumberType <String>
[-NetworkSiteId <String>] [-AssignmentCategory <String>] [-ReverseNumberLookup <String>] [-Notify] [<CommonParameters>]
1 more parameter sets — see the parameter table below.
Parameters (11)
Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.