Assign OnPremLineURI with TEAMS powershell

MAO Lorenzo (NPO) 1 Reputation point
2021-06-14T08:50:31.48+00:00

Hello,
in our company we used to assign on prem phone numbers to our users with the following commands:

Import-Module SkypeOnlineConnector  
$userCredential = Get-Credential  
$sfbSession = New-CsOnlineSession -Credential $userCredential  
Import-PSSession $sfbSession  
Grant-CsOnlineVoiceRoutingPolicy -PolicyName "audc-interop" -Identity nome.cognome@dominio  
Set-CsUser nome.cognome@dominio -EnterpriseVoiceEnabled $true -OnPremLineURI tel:+39XX109225XXX  

now that the SFB powershell moulde have been dimsissed i canf find the equavalent command to assign the lineuri in the teams powershell.
did someone know the procedure?
official documentation is still referring to the Set-CsUser cmdlet that is no more avilable.
thanks
Lorenzo

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,976 questions
Skype for Business
Skype for Business
A Microsoft communications service that provides communications capabilities across presence, instant messaging, audio/video calling, and an online meeting experience that includes audio, video, and web conferencing.
618 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. JimmyYang-MSFT 52,031 Reputation points Microsoft Vendor
    2021-06-15T03:03:13.59+00:00

    Hi @MAO Lorenzo (NPO)

    The command to configure the OnPremLineURI is:

    Set-CsUser -Identity username@keyman .com -OnPremLineURI "tel:+xxxxxxxxxxx"

    If you are receiving an error trying this way, please share the error with us.

    Please also share the MicrosoftTeams Module version you are using.

    To find the version, please run Get-Module on your PowerShell and find the MicrosoftTeams line on the list.


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. MAO Lorenzo (NPO) 1 Reputation point
    2021-06-15T06:16:14.73+00:00

    Hello @JimmyYang-MSFT ,

    ModuleType Version    Name                                ExportedCommands  
    ---------- -------    ----                                ----------------  
    Binary     1.0.3      MicrosoftTeams                      {Add-TeamUser, Connect-MicrosoftTeams, Disconnect-Microsof...  
      
      
    PS C:\WINDOWS\system32> Get-Module MicrosoftTeams | select -ExpandProperty ExportedCommands  
      
    Key                                   Value  
    ---                                   -----  
    Add-TeamUser                          Add-TeamUser  
    Connect-MicrosoftTeams                Connect-MicrosoftTeams  
    Disconnect-MicrosoftTeams             Disconnect-MicrosoftTeams  
    Get-CsPolicyPackage                   Get-CsPolicyPackage  
    Get-CsUserPolicyPackage               Get-CsUserPolicyPackage  
    Get-CsUserPolicyPackageRecommendation Get-CsUserPolicyPackageRecommendation  
    Get-Team                              Get-Team  
    Get-TeamChannel                       Get-TeamChannel  
    Get-TeamHelp                          Get-TeamHelp  
    Get-TeamsApp                          Get-TeamsApp  
    Get-TeamUser                          Get-TeamUser  
    Grant-CsUserPolicyPackage             Grant-CsUserPolicyPackage  
    New-Team                              New-Team  
    New-TeamChannel                       New-TeamChannel  
    New-TeamsApp                          New-TeamsApp  
    Remove-Team                           Remove-Team  
    Remove-TeamChannel                    Remove-TeamChannel  
    Remove-TeamsApp                       Remove-TeamsApp  
    Remove-TeamUser                       Remove-TeamUser  
    Set-Team                              Set-Team  
    Set-TeamArchivedState                 Set-TeamArchivedState  
    Set-TeamChannel                       Set-TeamChannel  
    Set-TeamsApp                          Set-TeamsApp  
    Get-CsBatchPolicyAssignmentOperation  Get-CsBatchPolicyAssignmentOperation  
    Invoke-CsBatchPolicyAssignment        Invoke-CsBatchPolicyAssignment  
      
      
    PS C:\WINDOWS\system32>  
    

    it seems to me that the command Set-CsUser is not provided in the teams powershell...
    Lorenzo


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.