Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This cmdlet will remove/unassign a phone number from a user or a resource account (online application instance).
Remove-CsPhoneNumberAssignment
-Identity <String>
-PhoneNumber <String>
-PhoneNumberType <String>
-Notify
[<CommonParameters>]
Remove-CsPhoneNumberAssignment
-Identity <String>
-RemoveAll
-Notify
[<CommonParameters>]
This cmdlet removes/unassigns a phone number from a user or resource account. The phone number continues to be available in the tenant.
Unassigning a phone number from a user or resource account will automatically set EnterpriseVoiceEnabled to False.
If the cmdlet executes successfully, no result object will be returned. If the cmdlet fails for any reason, a result object will be returned that contains a Code string parameter and a Message string parameter with additional details of the failure. Email notification to end user is a best effort operation. No error message will be displayed if the email fails to send.
Note: In Teams PowerShell Module 4.2.1-preview and later we are changing how the cmdlet reports errors. Instead of using a result object, we will be generating an exception in case of an error and we will be appending the exception to the $Error automatic variable. The cmdlet will also now support the -ErrorAction parameter to control the execution after an error has occurred.
Remove-CsPhoneNumberAssignment -Identity user1@contoso.com -PhoneNumber +12065551234 -PhoneNumberType CallingPlan
This example removes/unassigns the Microsoft Calling Plan telephone number +1 (206) 555-1234 from the user user1@contoso.com.
Remove-CsPhoneNumberAssignment -Identity user2@contoso.com -RemoveAll
This example removes/unassigns all the telephone number from user2@contoso.com.
Remove-CsPhoneNumberAssignment -Identity user1@contoso.com -PhoneNumber +12065551234 -PhoneNumberType CallingPlan -Notify
This example removes/unassigns the Microsoft Calling Plan phone number +1 (206) 555-1234 from the user user1@contoso.com and also sends an email notification to the user about the removal of telephone number.
Remove-CsPhoneNumberAssignment -Identity user2@contoso.com -RemoveAll -Notify
This example removes/unassigns all the telephone number from user2@contoso.com and also sends an email notification to the user about the change.
The Identity of the specific user or resource account. Can be specified using the value in the ObjectId, the SipProxyAddress, or the UserPrincipalName attribute of the user or resource account.
Type: | System.String |
Position: | named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Sends a best-effort email notification when a phone number is removed. Failures to send email are not reported.
Type: | Switch |
Position: | named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The phone number to unassign from the user or resource account. Supports E.164 format and non-E.164 format. Needs to be without the prefixed "tel:".
Type: | System.String |
Position: | named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The type of phone number to unassign from the user or resource account. The supported values are DirectRouting, CallingPlan and OperatorConnect.
Type: | System.String |
Position: | named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Unassigns the phone number from the user or resource account.
Type: | Switch |
Position: | named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
None
System.Object
The cmdlet is available in Teams PowerShell module 3.0.0 or later.
The cmdlet is only available in commercial and GCC cloud instances.
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in