Page tree
Skip to end of metadata
Go to start of metadata


In This Article


Overview

This article covers de-provisioning users from Teams Direct Routing.

After de-provisioning a user, you can remove their Phone System license.  If you are switching the user to use Microsoft's voice environment, keep the Phone System license assigned, and then add a Microsoft dial plan license.

WARNING:  Do not remove the Microsoft Phone System license to de-provision a direct routing user.  That will not completely clear the user's configuration.  The phone number assigned to the user will remain associated with the user account, and it cannot be cleared until you re-add the Phone System license and properly de-provision the user.


Check the User's Status

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*, 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:

  • Enabled - Indicates whether the user is enabled for MS Teams or Skype for Business Online.  If enabled is showing False, then the user account is either disabled (sign-in is blocked), or it doesn't have a license that includes MS Teams or Skype for Business Online.
  • EnterpriseVoiceEnabled - Indicates whether the user has been enabled for Enterprise Voice.  Enterprise voice has to be enabled for Teams Direct Routing to work.
  • OnPremLineURI - Specifies the Evolve IP provisioned phone number assigned to the user. The phone number must be specified using the E.164 format and be prefixed with "tel:".
  • LineURI - Shows the Evolve IP provisioned phone number assigned to the user based on the value of the OnPremLineURI parameter.  If this parameter has a phone number, and OnPremLineURI is blank, the user has been assigned a phone number from Microsoft.
  • InterpretedUserType - For Teams Direct Routing to work, this should show DirSyncSfBUser, PureOnlineSfBUser, DirSyncTeamsUser, or PureOnlineTeamsUser.
  • TeamsUpgradeEffectiveMode - For Teams Direct Routing to work, this should show TeamsOnly.
  • OnlineVoiceRoutingPolicy - When a user is configured for Teams Direct Routing, this should be set to an EIP-TDR-VRP voice routing policy.  To view a list of voice routing policies in your tenant use the Get-CsOnlineVoiceRoutingPolicy command.
  • TenantDialPlan - If this is blank, the user is assigned to the Global tenant dial plan. To view a list of dial plans in your tenant use the Get-CsTenantDialPlan command.
  • TeamsCallingPolicy - If this is blank, the user is assigned to the Global calling policy. To view a list of calling policies use the Get-CsTeamsCallingPolicy command.
  • TeamsCallParkPolicy - If this is blank, the user is assigned to the Global call park policy. To view a list of call park policies use the Get-CsTeamsCallParkPolicy command.
  • VoicePolicy - When enabled for Direct Routing, this should show HybridVoice.  If it shows BusinessVoice, the user has been assigned a Microsoft dial plan.  If it's blank, the user has not been assigned a Phone System license.
  • HostedVoicemail - Indicates whether the user has enabled their voicemail. By default, all users can enable/disable their voicemail from within the Teams app.
  • HostedVoicemailPolicy - If this shows BusinessVoice, the user's voicemail is hosted by Microsoft.  At this time Evolve IP does not plan to host voice mailboxes.  So, BusinessVoice should be the value you see.
  • OnlineDialinConferencingPolicy - If this shows ServiceAllowed, the user is enabled for Microsoft's Audio Conferencing.  If this is blank, the user is not enabled for Audio Conferencing.
  • OnlineDialOutPolicy - This policy defines the dial out restrictions from an audio conference.  A table of the different policies and their restrictions can be found in this Microsoft article.


Deprovision a Single User

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 Phone System 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
Set-CsUser -Identity $UPN -OnPremLineUri $null -EnterpriseVoiceEnabled $False


Deprovision All Users

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 Phone System 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 Unlimited | Where { $_.OnlineVoiceRoutingPolicy -like "*$($VrPolicyName)*"}

# Show a list of the users assigned to an EIP voice routing policy
$UserData | FT DisplayName, UserPrincipalName, OnlineVoiceRoutingPolicy

# 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
  Set-CsUser -Identity $User.UserPrincipalName -OnPremLineUri $null -EnterpriseVoiceEnabled $False

}



End Document