Teams Direct Routing : Set-csuser not available

Occasional Contributor



I'm trying to set the number & enable a user for Enterprise voice, but I'm getting an error that the term 'set-csuser' is not recognized. I've installed the latest version of the SkypeOnline Powershell module & also the Teams Powershell module:


Currently I can't enable any new user for enterprise voice or assign them numbers.


Has anyone got any ideas?




15 Replies
Just to add, this did work until a few months ago, it's been a while since I've had to do it but has worked previously without issue. It does seem to import the other commands (ie. get-csonlineuser)....
best response confirmed by sp-jmglade (Occasional Contributor)
For 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!

@sp-jmglade Thanks for this.  I banged my head against this for hours, and even the Microsoft Support rep didn't think about this.  It's surprising that they've merged so much functionality into the Teams admin center/role, but haven't merged some of the PowerShell commands into the Teams Admin role.

I am using the new stable Teams Powershell as "Global Admin" - but i also do not have the set-csuser.

Back to installing the Skype Online Powershell


can you explain to me how to install the Skype Online Powershell because i have the same issue Set-CsUSer is not working?


Install the Teams PowerShell Module but instead to Connect-MicrosoftTeams use

Import-Module MicrosoftTeams
$sfboSession = New-CsOnlineSession
Import-PSSession $sfboSession

Install Microsoft Teams PowerShell - Microsoft Teams | Microsoft Docs

this what I got 




Which version do you have? I think you need 1.1.6+

get-module microsoftteams



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 










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 -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.

Finally 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

sp-jmglade your fix worked, Thank You!! How is it that MS references Set-csuser for Teams in multiple documents but never indicates that you must have Skype rights. Then the error produced just tells you that the command is not recognized, at least the error should say you don't have sufficient rights!