Using MicrosoftTeams powershell module for Direct Routing user creation

Norton, Andrew 101 Reputation points
2021-05-05T23:32:58.403+00:00

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 https://learn.microsoft.com/en-us/microsoftteams/direct-routing-enable-users#ensure-that-the-user-is-homed-online-and-phone-number-is-not-being-synced-from-on-premises-applicable-for-skype-for-business-server-enterprise-voice-enabled-users-being-migrated-to-teams-direct-routing

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

SYNTAX
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.
10,312 questions
0 comments No comments
{count} votes

Accepted answer
  1. Norton, Andrew 101 Reputation points
    2021-05-07T13:52:22.297+00:00

    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 53,846 Reputation points Microsoft Vendor
    2021-05-06T08:27:15.347+00:00

    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.

    94401-18.png


    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
    2021-05-07T17:07:21.253+00:00

    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
    2021-07-13T22:47:56.557+00:00

    Hello,

    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

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.