SOLVED

Teams Direct Routing : Set-csuser not available

%3CLINGO-SUB%20id%3D%22lingo-sub-1656200%22%20slang%3D%22en-US%22%3ETeams%20Direct%20Routing%20%3A%20Set-csuser%20not%20available%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1656200%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20trying%20to%20set%20the%20number%20%26amp%3B%20enable%20a%20user%20for%20Enterprise%20voice%2C%20but%20I'm%20getting%20an%20error%20that%26nbsp%3B%3CSTRONG%3Ethe%20term%20'set-csuser'%20is%20not%20recognoized%3C%2FSTRONG%3E.%20I've%20installed%20the%20latest%20version%20of%20the%20SkypeOnline%20Powershell%20module%20%26amp%3B%20also%20the%20Teams%20Powershell%20module%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fteams-powershell-install%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fteams-powershell-install%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECurrently%20I%20can't%20enable%20any%20new%20user%20for%20enterprise%20voice%20or%20assign%20them%20numbers.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHas%20anyone%20got%20any%20ideas%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3EJoni.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1656200%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ECalling%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESettings%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1656209%22%20slang%3D%22en-US%22%3ERe%3A%20Teams%20Direct%20Routing%20%3A%20Set-csuser%20not%20available%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1656209%22%20slang%3D%22en-US%22%3EJust%20to%20add%2C%20this%20did%20work%20until%20a%20few%20months%20ago%2C%20it's%20been%20a%20while%20since%20I've%20had%20to%20do%20it%20but%20has%20worked%20previously%20without%20issue.%20It%20does%20seem%20to%20import%20the%20other%20commands%20(ie.%20get-csonlineuser)....%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1656278%22%20slang%3D%22en-US%22%3ERe%3A%20Teams%20Direct%20Routing%20%3A%20Set-csuser%20not%20available%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1656278%22%20slang%3D%22en-US%22%3EFor%20anyone%20who%20gets%20this%2C%20you%20need%20to%20have%20the%20Skype%20for%20Business%20Administrator%20role%20within%20Azure%20AD%20to%20have%20the%20commands%20brought%20in%2C%20having%20Teams%20Service%20Administrator%20isn't%20enough!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1788262%22%20slang%3D%22en-US%22%3ERe%3A%20Teams%20Direct%20Routing%20%3A%20Set-csuser%20not%20available%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1788262%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F261783%22%20target%3D%22_blank%22%3E%40sp-jmglade%3C%2FA%3E%26nbsp%3BThanks%20for%20this.%26nbsp%3B%20I%20banged%20my%20head%20against%20this%20for%20hours%2C%20and%20even%20the%20Microsoft%20Support%20rep%20didn't%20think%20about%20this.%26nbsp%3B%20It's%20surprising%20that%20they've%20merged%20so%20much%20functionality%20into%20the%20Teams%20admin%20center%2Frole%2C%20but%20haven't%20merged%20some%20of%20the%20PowerShell%20commands%20into%20the%20Teams%20Admin%20role.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1932986%22%20slang%3D%22en-US%22%3ERe%3A%20Teams%20Direct%20Routing%20%3A%20Set-csuser%20not%20available%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1932986%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20using%20the%20new%20stable%20Teams%20Powershell%20as%20%22Global%20Admin%22%20-%20but%20i%20also%20do%20not%20have%20the%20set-csuser.%3C%2FP%3E%3CP%3EBack%20to%20installing%20the%20Skype%20Online%20Powershell%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2161622%22%20slang%3D%22en-US%22%3ERe%3A%20Teams%20Direct%20Routing%20%3A%20Set-csuser%20not%20available%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2161622%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F533323%22%20target%3D%22_blank%22%3E%40StephanGee%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ecan%20you%20explain%20to%20me%20how%20to%26nbsp%3B%3CSPAN%3Einstall%20the%20Skype%20Online%20Powershell%20because%20i%20have%20the%20same%20issue%20Set-CsUSer%20is%20not%20working%3F%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2161833%22%20slang%3D%22en-US%22%3ERe%3A%20Teams%20Direct%20Routing%20%3A%20Set-csuser%20not%20available%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2161833%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F281125%22%20target%3D%22_blank%22%3E%40Mohamed_Soliman%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EInstall%20the%20Teams%20PowerShell%20Module%20but%20instead%20to%20Connect-MicrosoftTeams%20use%3C%2FP%3E%3CP%3EImport-Module%20MicrosoftTeams%3CBR%20%2F%3E%24sfboSession%20%3D%20New-CsOnlineSession%3CBR%20%2F%3EImport-PSSession%20%24sfboSession%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fteams-powershell-install%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EInstall%20Microsoft%20Teams%20PowerShell%20-%20Microsoft%20Teams%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2265508%22%20slang%3D%22en-US%22%3ERe%3A%20Teams%20Direct%20Routing%20%3A%20Set-csuser%20not%20available%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2265508%22%20slang%3D%22en-US%22%3EFinally%20we%20Found%20the%20problem%20and%20Fixed%20by%20Microsoft%20Support%20Teams.%3CBR%20%2F%3EThe%20problem%20was%20the%20Users%20are%20homed%20on%20premises%20interact%20with%20on-premises%20Skype%20for%20Business%20servers.%20and%20to%20allow%20direct%20routing%20the%20users%20should%20homed%20online%20and%20to%20do%20this%20you%20should%20change%20the%20user%20attributes%20on%20the%20active%20directory%3CBR%20%2F%3EMake%20all%20ms-RTCSIP-%20******%20to%20not%20set%20and%20change%20the%20proxy%20address%20to%20SIP%3AUSER%40Domain.com%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2265510%22%20slang%3D%22en-US%22%3ERe%3A%20Teams%20Direct%20Routing%20%3A%20Set-csuser%20not%20available%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2265510%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Mohamed_Soliman_0-1618073705325.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F271695iDD48C66B36BE89F9%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Mohamed_Soliman_0-1618073705325.png%22%20alt%3D%22Mohamed_Soliman_0-1618073705325.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F281125%22%20target%3D%22_blank%22%3E%40Mohamed_Soliman%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2162180%22%20slang%3D%22en-US%22%3ERe%3A%20Teams%20Direct%20Routing%20%3A%20Set-csuser%20not%20available%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2162180%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F533323%22%20target%3D%22_blank%22%3E%40StephanGee%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3Ethis%20what%20I%20got%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Mohamed_Soliman_0-1614164965764.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F257344i574C94E4432EE54A%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Mohamed_Soliman_0-1614164965764.png%22%20alt%3D%22Mohamed_Soliman_0-1614164965764.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2162289%22%20slang%3D%22en-US%22%3ERe%3A%20Teams%20Direct%20Routing%20%3A%20Set-csuser%20not%20available%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2162289%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F281125%22%20target%3D%22_blank%22%3E%40Mohamed_Soliman%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhich%20version%20do%20you%20have%3F%20I%20think%20you%20need%201.1.6%2B%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3Eget-module%20microsoftteams%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2162504%22%20slang%3D%22en-US%22%3ERe%3A%20Teams%20Direct%20Routing%20%3A%20Set-csuser%20not%20available%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2162504%22%20slang%3D%22en-US%22%3E%3CP%3EYes%20It's%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Mohamed_Soliman_0-1614175602097.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F257388i447CD768FB795A77%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Mohamed_Soliman_0-1614175602097.png%22%20alt%3D%22Mohamed_Soliman_0-1614175602097.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F533323%22%20target%3D%22_blank%22%3E%40StephanGee%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2566878%22%20slang%3D%22en-US%22%3ERe%3A%20Teams%20Direct%20Routing%20%3A%20Set-csuser%20not%20available%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2566878%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F261783%22%20target%3D%22_blank%22%3Esp-jmglade%3C%2FA%3E%26nbsp%3Byour%20fix%20worked%2C%20Thank%20You!!%20How%20is%20it%20that%20MS%20references%20Set-csuser%20for%20Teams%20in%20multiple%20documents%20but%20never%20indicates%20that%20you%20must%20have%20Skype%20rights.%20Then%20the%20error%20produced%20just%20tells%20you%20that%20the%20command%20is%20not%20recognized%2C%20at%20least%20the%20error%20should%20say%20you%20don't%20have%20sufficient%20rights!%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi,

 

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: https://docs.microsoft.com/en-us/microsoftteams/teams-powershell-install

 

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

 

Has anyone got any ideas?

 

Thanks,

Joni.

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)
Solution
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

@StephanGee 

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

@Mohamed_Soliman 

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

@StephanGee 
this what I got 

Mohamed_Soliman_0-1614164965764.png

 

@Mohamed_Soliman 

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

get-module microsoftteams

@Mohamed_Soliman 

 

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 

Mohamed_Soliman_0-1614237721172.png

 

 

 

 

 

 @jangliss 

@Mohamed_Soliman 

 

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.

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 SIP:USER@Domain.com

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!