Forum Discussion

dafo43's avatar
dafo43
Copper Contributor
Jan 19, 2024
Solved

Get-CsOnlineUser access denied via Azure application

Hi,


I'm trying run the Get-CsOnlineUser command via an Azure App that connects using the MicrosoftTeams module:


Connect-MicrosoftTeams -CertificateThumbprint $thumbprint -ApplicationId $clientID -TenantId $tenantID


I run the command: Get-CsOnlineUser -Identity xxx


but get the error:

Get-CsOnlineUser: Access Denied.


I tried the latest versions of the Teams module, including the beta (5.8.1) but get the same error.


According to Microsoft the CS command should work with the API permission Organization.Read.All which I have set - https://learn.microsoft.com/en-us/microsoftteams/teams-powershell-application-authentication#cmdlets-supported

 

  • Hello,
    does the service principal of the application have the role of Teams Administrator? That is needed as well, we are able to do it this way.

3 Replies

  • fbrem_uzh's avatar
    fbrem_uzh
    Copper Contributor
    Hello,
    does the service principal of the application have the role of Teams Administrator? That is needed as well, we are able to do it this way.
    • JeroenVanDenDooren's avatar
      JeroenVanDenDooren
      Copper Contributor

      fbrem_uzh 

      I can't seem to locate where I can give a registered app teams administrator permissions,

      is it part of the graph api?

    • dafo43's avatar
      dafo43
      Copper Contributor
      That is protected by PIM, so I can't use that. I'm hoping that I can add the Skype for Business admin role instead.

Resources