Skip to main content

Adding/assigning additional phone numbers/removing

You have completed the initial configuration and now want to make adjustments on the Phone team system.

In advance, you added/removed the "Microsoft Teams option" in the customer or partner portal for the desired phone number and added/removed the Microsoft telephony license to the team 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.1.0 -AllowClobber
  • Finish PowerShell after installing the module.
info

You can miss this step should your module be up to date.

2. Start the 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

Choose whether you want to add or remove sipcall numbers from the Phone System team:

3.1a Assign phone number

Assign the desired sipcall number to any existing Microsoft 365 user or team resources account with the following command to:

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.ch" -PhoneNumber "+41441234001" -PhoneNumberType DirectRouting
Set-CsPhoneNumberAssignment -identity "marge.simpson@thesimpsons.ch" -PhoneNumber "+41441234002" -PhoneNumberType DirectRouting
Set-CsPhoneNumberAssignment -identity "bart.simpson@thesimpsons.ch" -PhoneNumber "+41441234003" -PhoneNumberType DirectRouting
Set-CsPhoneNumberAssignment -identity "mainnumber@thesimpsons.ch" -PhoneNumber "+41441234000" -PhoneNumberType DirectRouting

3.2a Assigne policy

You can assign the policy individually or for several users as a batch:

Grant a user permission for the policy:

Grant-CsOnlineVoiceRoutingPolicy -Identity "yourusername@yourcompany.com" -PolicyName "sipcall"
Example:
   Grant-CsOnlineVoiceRoutingPolicy -Identity "homer.simpson@thesimpsons.ch" -PolicyName "sipcall"
Grant-CsOnlineVoiceRoutingPolicy -Identity "marge.simpson@thesimpsons.ch" -PolicyName "sipcall"
Grant-CsOnlineVoiceRoutingPolicy -Identity "bart.simpson@thesimpsons.ch" -PolicyName "sipcall"
Grant-CsOnlineVoiceRoutingPolicy -Identity "mainnumber@thesimpsons.ch" -PolicyName "sipcall"

4. Check Configuration

Afterward, test according to the Check Configuration article.

5. End PowerShell Session

End the PowerShell session:

Disconnect-MicrosoftTeams 
note

Allow Microsoft some time after completing the configuration.
It may take up to 1 hour for the configuration to take full effect.