In This Article |
This article covers deprovisioning users for Teams direct routing in the Teams Admin Center (TAC) and PowerShell.
NOTE After deprovisioning a user, you can remove their Teams Phone add-on license. If you are switching the user to use Microsoft's voice environment, keep the Teams Phone add-on license assigned, and then add a Microsoft calling plan license. |
WARNING Do not remove the Teams Phone add-on license to de-provision a direct routing user. Removing the Teams Phone add-on license will not clear the user's direct routing configuration. Also, the phone number assigned to the user will remain associated with the user account, and it cannot be assigned to another user until it is cleared, or you delete the user account from your environment. If you need to clear the phone number from an unlicensed user account, you will need to re-assign the Teams Phone add-on license, and properly de-provision the user. |
These steps show you how to deprovision a single user account for Teams direct routing in the Teams Admin Center (TAC). The TAC does not provide any feedback on a user's current direct routing status. If you need to check the status of a user's configuration, or do any troubleshooting, you should use PowerShell.
NOTE Make sure the user account is still properly licensed before removing their direct routing configuration. Do not remove the Teams Phone add-on license to de-provision a direct routing user. The user account should have a license that includes MS Teams, and the Teams Phone add-on license. Details on licensing requirements can be found in the Teams Direct Routing - 01 - Planning and Prerequisites article. |
Sign into the Teams Admin Center (TAC): https://admin.teams.microsoft.com
Users > Manage Users > Click on a user's Display Name to view their settings
Next to General Information, click Edit.
In the right-hand flyout pane, clear the assigned phone number.
Click the Apply button at the bottom of the flyout pane.
The user account's properties will update to show the phone number removed.
Select the user account's Polices tab
Edit the Assigned Policies
In the right-hand flyout pane, towards the bottom of the policy list, select the Global policy configuration for the following:
Click the Apply button at the bottom of the flyout pane.
The user's policy assignments will update to show the applied changes.
NOTE It can take up to 24 hours for Microsoft's services to apply the changes. Normally it takes 10-30 minutes. |
These steps show you how to deprovision one or more user accounts from Teams direct routing using PowerShell. Before performing these steps make sure you are connected to your Microsoft Teams services using PowerShell. If needed, review the Teams Direct Routing - 01 - Planning and Prerequisites article for details.
The below commands can be used to view the voice properties of a user. This can be useful for checking the status of a user before and after deprovisioning.
# Review a list of the user's properties related to Direct Routing Get-CsOnlineUser user@domain.com | FL Displ*, UserPri*, SipA*, IsSipEnabled, Inter*, TeamsUpgradeE*, Enterprise*, OnlineVoiceR*, TeamsCall*, TenantD*, OnlineDial*, 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 2147483647 | Select Displ*, UserPri*, SipA*, IsSipEnabled, Inter*, TeamsUpgradeE*, Enterprise*, OnlineVoiceR*, TeamsCall*, TenantD*, OnlineDial*, LineURI | Export-Csv $CsvFilePath -nti |
Here's a description of the more important properties outputted with the above Get-CsOnlineUser commands:
The following will deprovision a single user from direct routing, and disable their Enterprise Voice features. When you're done, you can then remove the Teams Phone add-on license from the user account. This change will not affect any Audio Conferencing features.
Deprovision the User from Direct Routing. Make sure you modify line 2 to include the user's UPN.
# Define the user's UPN $UPN = "user@domain.com" # This will deprovision the user's account for Direct Routing # and set their account to use the global voice routing policy Grant-CsOnlineVoiceRoutingPolicy -Identity $UPN -PolicyName $null Grant-CsTenantDialPlan -Identity $UPN -PolicyName $null Remove-CsPhoneNumberAssignment -Identity $UPN -RemoveAll |
The following will deprovision all users that are currently configured with Direct Routing using an Evolve IP voice routing policy, and also disables their Enterprise Voice features. When you're done, you can remove the Teams Phone add-on license from the user accounts. This change will not affect any Audio Conferencing features.
Get all users assigned to an EIP voice routing policy.
# Search string to find the EIP voice routing policies $VrPolicyName = "EvolveIP" # Get all users assigned to an Evolve IP voice routing policy $UserData = Get-CsOnlineUser -ResultSize 2147483647 | Where { $_.OnlineVoiceRoutingPolicy -like "*$($VrPolicyName)*"} # Show a list of the users assigned to an EIP voice routing policy $UserData | FT DisplayName, UserPrincipalName, OnlineVoiceRoutingPolicy, OnPremLineUri # Show the number of users assigned to an EIP voice routing policy $UserData.UserPrincipalName.Count |
Deprovision the list of users, and disable their Enterprise Voice features.
# This will loop through each user ForEach ($User in $UserData) { # These commands will deprovision the user's account for direct routing # and set their account to the global voice routing policy Grant-CsOnlineVoiceRoutingPolicy -Identity $User.UserPrincipalName -PolicyName $null Grant-CsTenantDialPlan -Identity $User.UserPrincipalName -PolicyName $null Remove-CsPhoneNumberAssignment -Identity $User.UserPrincipalName -RemoveAll } |