Share via

Permissions needed to use "Set-CsPhoneNumberAssignment" with App Registrations and Powershell script

Gus-0185 145 Reputation points
2024-04-03T18:58:04.54+00:00

Hello,

I'm trying to use the following module using an App registrations on Microsoft Entra. To do so I connect to the App Registration using a powershell script that connect to Microsoft Teams "Connect-MicrosoftTeams":

"Set-CsPhoneNumberAssignment -Identity $member.UserPrincipalName -EnterpriseVoiceEnabled $true"

When running this script I receive the following error : Microsoft.Teams.ConfigAPI.Cmdlets.internal\Set-CsPhoneNumberAssignment : Access Denied.

What additional permissions does my app need to use "Set-CsPhoneNumberAssignment" successfully?

My app currently has the following permissions: Microsoft Graph : "Group.ReadWrite.All" "TeamSettings.ReadWrite.All". I have tried other permissions, but with no luck.

Thank you!

Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Microsoft Graph

Answer accepted by question author

  1. CarlZhao-MSFT 46,456 Reputation points
    2024-04-04T06:37:35.2166667+00:00

    Hi @Gus

    In addition to the above permissions, you also need to ensure that the user logged into MicrosoftTeams has the teams administrator or global administrator role.

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

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