In This Article |
This article covers provisioning a single user for Teams Direct Routing, and also using a CSV file to provision multiple users at the same time.
Regardless of which method you use to provision your users, first connect to your Microsoft Teams services using PowerShell. If needed, review the Teams Direct Routing - 01 - Planning and Prerequisites article for details.
IMPORTANT Make sure your user accounts have been licensed before running these commands. They should have a license that includes MS Teams, and the Phone System license. Details can be found in the Teams Direct Routing - 01 - Planning and Prerequisites article. |
TIP If you are switching a user from a Microsoft calling plan to Teams direct routing, remove the phone number from the user, and then remove the calling plan license. Make sure you keep the Phone System license assigned. |
The below commands can be used to view the voice properties of one or more users. This can be useful for checking the status of a user before and after configuring them for Direct Routing.
# Review a list of the user's properties related to Direct Routing Get-CsOnlineUser user@domain.com | FL Displ*, UserPri*, SipA*, Enabled, Inter*, TeamsUpgradeE*, Enterprise*, OnlineVoiceR*, TeamsCall*, TenantD*, VoiceP*, HostedVoicemail*, OnlineDial*, OnPremLineURI, LineURI # Review all of the user's properties Get-CsOnlineUser user@domain.com | FL * # Export a list of all voice users and their properties to a CSV file $CsvFilePath = "C:\Path\to\file.csv" Get-CsOnlineUser -ResultSize Unlimited | Select Displ*, UserPri*, SipA*, Enabled, Inter*, TeamsUpgradeE*, Enterprise*, OnlineVoiceR*, TeamsCall*, TenantD*, VoiceP*, HostedVoicemail*, OnlineDial*, OnPremLineURI, LineURI | Export-Csv $CsvFilePath -nti |
Here's a description of the more important properties outputted with the above commands:
Get the name of the EIP Voice Routing Policy, which has to be entered into the below block of PowerShell code.
Get-CsOnlineVoiceRoutingPolicy | Where { $_.Identity -like "*Evolve*" } |
Get the name of the EIP Tenant Dial Plan, which has to be entered in the below block of PowerShell code.
Get-CsTenantDialPlan | Where { $_.Identity -like "*Evolve*" } |
Provision a User for Direct Routing
NOTE Microsoft requires that all phone numbers be in the E.164 format. This means the following:
|
IMPORTANT In the below PowerShell code, be sure to change the relevant data on lines 2, 5, 8, & 11 to match your configuration and specific user. |
# Enter the name of the Evolve IP voice routing policy $VrPolicyName = "EvolveIP-USEast" # Enter the name of the Evolve IP tenant dial plan $TdpPolicyName = "EvolveIP-TenantDialPlan" # Enter the user's user principal name $UPN = "user@domain.com" # Enter the user's telephone number (no spaces, dashes, or parentheses) $Phone = "tel:+16105551234" ### Begin User Provisioning ### # This will check if the user's coexistence mode is set to TeamsOnly for Direct # Routing. If it is not set to TeamsOnly, it will be set. If ((Get-CsOnlineUser $UPN).TeamsUpgradeEffectiveMode -ne "TeamsOnly") { Grant-CsTeamsUpgradePolicy -Identity $UPN -PolicyName UpgradeToTeams } # This will configure the user's account for direct routing and add the account # to the voice routing policy & tenant dial plan Set-CsUser -Identity $UPN -OnPremLineUri $Phone -EnterpriseVoiceEnabled $true -HostedVoiceMail $true Grant-CsOnlineVoiceRoutingPolicy -Identity $UPN -PolicyName $VrPolicyName Grant-CsTenantDialPlan -Identity $UPN -PolicyName $TdpPolicyName ### End User Provisioning ### |
CSV File Requirements
Create or use an existing CSV file that contains the following required fields:
DisplayName - User account display Name
UserUPN - User account's User Principal Name (Office 365 sign in address)
PhoneNumber - Assigned phone number including the country code (no special characters or spaces)
Here's an example for the US region:
DisplayName | UserUPN | PhoneNumber | Location |
---|---|---|---|
George Kastanza | jkastanza@seinfeild.com | 16105551234 | east |
Elaine Benes | ebenes@seinfeild.com | 16105551235 | west |
Here's an example for the EU region:
DisplayName | UserUPN | PhoneNumber | Location |
---|---|---|---|
Cosmo Kramer | ckramer@seinfeild.com | 31884281234 | NNpeer01 |
Newman | newman@seinfeild.com | 31884221234 | NNpeer02 |
Provision Users from a CSV File
TIP Paste the below PowerShell code into an editor like the PowerShell ISE or VSCode, and run it from there. |
First, get the name of your Voice Routing Policies and Tenant Dial Plan, which has to be entered into the below block of US or EU PowerShell code on lines 8, 9, & 12.
Get-CsOnlineVoiceRoutingPolicy | Where { $_.Identity -like "*Evolve*" } Get-CsTenantDialPlan | Where { $_.Identity -like "*Evolve*" } |
Next, use these blocks of code, depending on your region, with the output from the previous query on lines 8, 9, & 12. Also define the path to your CSV file on line 5.
spacer |
spacer |