Add/Assign/Remove Additional Phone Number/s
You have completed the initial configuration and now want to make adjustments to the Teams Phone System.
Prior to this, you have added/removed the "Microsoft Teams" option in the customer or partner portal for the desired phone number and added/removed the Microsoft license for telephony to the Teams user.
1. Preparation
1.1 Install/update "Microsoft Teams" module
- Open PowerShell as administrator.
- Install or update the Microsoft Teams module with the following command:
Set-ExecutionPolicy RemoteSigned -Force
Install-Module MicrosoftTeams -RequiredVersion 7.6.0 -AllowClobber
- Finish PowerShell after installing the module.
You can skip this step if your module is up to date.
2. Start session
- Reopen PowerShell (PowerShell as administrator does not need)
- Import the Team PowerShell module
Import-Module MicrosoftTeams
- To start working with the Microsoft Teams PowerShell module, type the following command:
Connect-MicrosoftTeams
- The following is a pop-up for Microsoft 365 authentication. Your user must be assigned the Microsoft role "Global Administrator" or "Team Administrator".
3. Add/remove additional phone number/s
Choose whether you want to add or remove sipcall phone numbers from the Teams Phone System:
- Add additional phone number (Option a)
- Remove phone number/s (Option b)
3.1a Assign phone number
Assign the desired sipcall number to any existing Microsoft 365 user or team resources account with the following command:
Set-CsPhoneNumberAssignment -identity "yourusername@yourcompany.com" -PhoneNumber "+<sipcallPhoneNumber>" -PhoneNumberType DirectRouting
Example with 3 users and a "Team Resources Account" (for team telephone auto attendant):
Set-CsPhoneNumberAssignment -identity "homer.simpson@thesimpsons.com" -PhoneNumber "+41441234001" -PhoneNumberType DirectRouting
Set-CsPhoneNumberAssignment -identity "marge.simpson@thesimpsons.com" -PhoneNumber "+41441234002" -PhoneNumberType DirectRouting
Set-CsPhoneNumberAssignment -identity "bart.simpson@thesimpsons.com" -PhoneNumber "+41441234003" -PhoneNumberType DirectRouting
Set-CsPhoneNumberAssignment -identity "mainnumber@thesimpsons.com" -PhoneNumber "+41441234000" -PhoneNumberType DirectRouting
3.2a Assign policy
You can assign the policy individually or for several users as a batch:
- Assign variant individually
- Assign batch variant
Grant a user permission for the policy:
Grant-CsOnlineVoiceRoutingPolicy -Identity "yourusername@yourcompany.com" -PolicyName "sipcall"
Example:
Grant-CsOnlineVoiceRoutingPolicy -Identity "homer.simpson@thesimpsons.com" -PolicyName "sipcall"
Grant-CsOnlineVoiceRoutingPolicy -Identity "marge.simpson@thesimpsons.com" -PolicyName "sipcall"
Grant-CsOnlineVoiceRoutingPolicy -Identity "bart.simpson@thesimpsons.com" -PolicyName "sipcall"
Grant-CsOnlineVoiceRoutingPolicy -Identity "mainnumber@thesimpsons.com" -PolicyName "sipcall"
Replace yourusername1@yourcompany.com, yourusername2@yourcompany.com with your users and add more if needed.
$users_ids = @("yourusername1@yourcompany.com","yourusername2@yourcompany.com")
New-CsBatchPolicyAssignmentOperation -PolicyType OnlineVoiceRoutingPolicy -PolicyName "sipcall" -Identity $users_ids -OperationName "Batch assign voice routing"
Example:
$users_ids = @("homer.simpson@thesimpsons.com","marge.simpson@thesimpsons.com","bart.simpson@thesimpsons.com","mainnumber@thesimpsons.com")
New-CsBatchPolicyAssignmentOperation -PolicyType OnlineVoiceRoutingPolicy -PolicyName "sipcall" -Identity $users_ids -OperationName "20240418 batch ticket aaa-bb-123"
3.1b Remove telephony features
Disable the telephony features for the desired users and remove the phone number using the following command:
Remove-CsPhoneNumberAssignment -Identity "yourusername@yourcompany.com" -RemoveAll
Example:
Remove-CsPhoneNumberAssignment -Identity "homer.simpson@thesimpsons.com" -RemoveAll
Remove-CsPhoneNumberAssignment -Identity "marge.simpson@thesimpsons.com" -RemoveAll
Remove-CsPhoneNumberAssignment -Identity "bart.simpson@thesimpsons.com" -RemoveAll
Remove-CsPhoneNumberAssignment -Identity "mainnumber@thesimpsons.com" -RemoveAll
4. Check configuration
Afterward, test according to the article Check configuration.
5. End PowerShell session
End the PowerShell session:
Disconnect-MicrosoftTeams
Allow Microsoft some time after completing the configuration. It may take up to 1 hour for the configuration to take full effect.