Share via

Using Registered app to run Teams commandlets permission issue

Jeroen Van Den Dooren 0 Reputation points
2024-08-12T17:28:56.6133333+00:00

Hi all, I’m running on fumes here, spent an afternoon looking into what I might be doing wrong:

I have a basic powershell script (almost 1-1 from ms docs)


$tenantId

this succesfully connects; i get the nice reply containing account environment tenant etc.

I can after this also run get-team and it fetches all my teams.

I’m now trying to use the CS scripts simple stuff like ‘Get-CsOnlineUser’ but I immediatly get unauthorized reply…

I’ve made the registerred app teams admin givin it waaaay to many permissions in graph but still to no avail…

Is there any known way to check the permissions that I could need to give / log more?

If i run the Get-CsOnlineUser code with my admin user it just works…

Extra info: I’m using step 6 → Connect-MicrosoftTeams (MicrosoftTeamsPowerShell) | Microsoft Learn

in the documentation it even states:

  • For *-Cs cmdlets - the Microsoft Graph API permission needed is Organization.Read.All.

which I have given (even delegated)

anyone here who has a clue how I can even check a log stating possible privilege issues?

0 comments No comments

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.