Commands › Microsoft Teams
Remove-CsPhoneNumberAssignment
Removes or unassigns a phone number from a user or resource account (online application instance).
Quick start script
# Remove-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
Remove-CsPhoneNumberAssignment -Identity <String> -TelephoneNumber <String> -NumberType <String>
# 4. Verify and diff
$after = Get-CsPhoneNumberAssignment
Compare-Object ($before | Out-String) ($after | Out-String)
Syntax — 2 parameter sets
RemoveSome (Default)
Remove-CsPhoneNumberAssignment -Identity <String> -TelephoneNumber <String> -NumberType <String>
[-HttpPipelinePrepend <SendAsyncStep[]>] [-Notify] [-AssignmentBlockedForever] [-AssignmentBlockedDays <Integer>] [<CommonParameters>]
RemoveAll
Remove-CsPhoneNumberAssignment -Identity <String> [-HttpPipelinePrepend <SendAsyncStep[]>] [-RemoveAll]
[-Notify] [<CommonParameters>]
Parameters (8)
Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.