Using MicrosoftTeams powershell module for Direct Routing user creation

Norton, Andrew 101 Reputation points

The documentation references SkypeOnlineConnector yet that has been deprecated and no longer available. The MicrosoftTeams PowerShell module doesn't recognize the Set-CsUser cmdlet the same as what is documented

When using the Set-CsUser cmdlet in MicrosoftTeams module it has different parameters and then errors with "Set-CsUser_SetExpanded: Access Denied."

Set-CsUser -Id <String> [-EnterpriseVoiceEnabled] [-HostedVoiceMail] [-PhoneNumber <String>] [-Break] [-HttpPipelineAppend <SendAsyncStep[]>]
[-HttpPipelinePrepend <SendAsyncStep[]>] [-Proxy <Uri>] [-ProxyCredential <PSCredential>] [-ProxyUseDefaultCredentials] [-WhatIf] [-Confirm] [<CommonParameters>]

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
8,646 questions
0 comments No comments
{count} votes

Accepted answer
  1. Norton, Andrew 101 Reputation points

    Hi @JimmyYang-MSFT any further thoughts? On Version 2.3.0 of MicrosoftTeams module and unable to execute any of the Set-CsUser commands.

    Function Set-CsUser 2.3.0 MicrosoftTeams
    Function Set-CsUserAcp 2.3.0 MicrosoftTeams
    Function Set-CsUserPstnSettings 2.3.0 MicrosoftTeams
    Function Set-CsUserServicesPolicy 2.3.0 MicrosoftTeams
    Function Set-CsVideoInteropServiceProvider 2.3.0 MicrosoftTeams
    Function Set-CsVoiceNormalizationRule 2.3.0 MicrosoftTeams
    Function Start-CsExMeetingMigration 2.3.0 MicrosoftTeams
    Function Switch-CsOnlineApplicationEndpoint 2.3.0 MicrosoftTeams
    Function Sync-CsOnlineApplicationInstance 2.3.0 MicrosoftTeams
    Function Test-CsEffectiveTenantDialPlan 2.3.0 MicrosoftTeams
    Function Test-CsInboundBlockedNumberPattern 2.3.0 MicrosoftTeams
    Function Test-CsOnlineCarrierPortabilityIn 2.3.0 MicrosoftTeams
    Function Test-CsOnlineLisCivicAddress 2.3.0 MicrosoftTeams

    The link above states to use SkypeOnlineConnector yet that is no longer available and it says MicrosoftTeams module has the SkypeOnlineConnector.

    PS /Users/user123> Set-CsUser -Identity "a@X .com" -OnPremLineURI +151xxxx
    Set-CsUser: A parameter cannot be found that matches parameter name 'Identity'.
    PS /Users/user123> Set-CsUser -Id "a@X .com" -OnPremLineURI +151xxxx
    Set-CsUser: A parameter cannot be found that matches parameter name 'OnPremLineURI'.
    PS /Users/user123> Set-CsUser -Id "a@X .com" -PhoneNumber +151xxxx
    Set-CsUser_SetExpanded: Access Denied.

3 additional answers

Sort by: Most helpful
  1. JimmyYang-MSFT 47,206 Reputation points Microsoft Vendor

    Hi @NortonAndrew-5553

    The command "Set-CsUser" seems not in Teams PowerShell Module. So they cannot recognize it. The command can only be used in the on-premise environment. You could try to run the command "Get-Command -Module MicrosoftTeams" to check it.


    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.

  2. Dan Hedley 1 Reputation point

    I've been wrestling with this today and made very little progress other than realising the parameters for set-csuser are now a little different. Am however now hitting the Access Denied problem as others have mentioned.

    0 comments No comments

  3. JosephBaca 1 Reputation point


    The cmdlet is in the 2.3.1 module, the issue as DanHedley mentioned. "Skype for Business Online PowerShell connections are blocked" is the issue we are facing atm.

    I guess we are waiting for an updated Teams module to be released.

    0 comments No comments