Forum Discussion
Teams Direct Routing : Set-csuser not available
- Sep 11, 2020For anyone who gets this, you need to have the Skype for Business Administrator role within Azure AD to have the commands brought in, having Teams Service Administrator isn't enough!
The Get-CsOnlineUser and Set-CsUser commands are not in the MicrosoftTeams module, but inside the module that gets imported when you create your session with the admin center.
Import-Module MicrosoftTeams
$csSession = New-CsOnlineSession
Import-Session $csSession
Get-Command -module tmp* -Name *csuser*
Also see the previous comment on this thread about the additional permissions that are required.
NowI have the following permissions:
Skype for Business administrator
Teams Administrator
teams Communication admin
teams communication support engineer
teams communication support specialist
teams device administrator
and this what I got
- Ahmed_FarhanApr 10, 2021Copper Contributor
- Ahmed_FarhanApr 10, 2021Copper ContributorFinally we Found the problem and Fixed by Microsoft Support Teams.
The problem was the Users are homed on premises interact with on-premises Skype for Business servers. and to allow direct routing the users should homed online and to do this you should change the user attributes on the active directory
Make all ms-RTCSIP- ****** to not set and change the proxy address to SIP:USER@Domain.com - janglissFeb 25, 2021Iron Contributor
The -LineURI parameter is not available to MS Teams or Skype for Business Online. You need to use -OnPremLineURI as documented in the Enable users for Direct Routing, voice, and voicemail So your command would look more like this:
Set-CsUser -Identity abc@example.com -OnPremLineUri 'tel:+1234567890' -EnterpriseVoiceEnabled $true -HostedVoiceEnabled $true
If you are synchronizing Active Directory to Azure Active Directory, and you're trying to set a phone number, check if the msRTCSIP-Line attribute is set or not. If that value is set, you may have it being synchronized, which will impact how the Set-CsUser command will work in applying and removing a phone number. The same URL above has a section detailing that if you are using SfB on-premises.