The only thing you can do here is add the permissions, or request your admins to do so.
Error when executing the command "Get-MgTeamChannelMessage"
The following error occurs when executing the command "Get-MgTeamChannelMessage".
I cannot assign the "ChannelMessage.Read.All" authority due to the restrictions of the organization I belong to. Please let us know how to deal with this case.
Get-MgTeamChannelMessage : Missing scope permissions on the request. API requires one of 'ChannelMessage.Read.All'. ScoAPI requires one of 'ChannelMessage.Read.All'.
Microsoft Security | Microsoft Graph
4 answers
Sort by: Most helpful
-
Vasil Michev 119.5K Reputation points MVP Volunteer Moderator
2023-06-27T17:25:27.1733333+00:00 -
Konstantinos Passadis 19,586 Reputation points MVP
2023-07-03T23:43:07.12+00:00 Hello @Mina !
Welcome to Microsoft QnA!
As @Vasil Michev already explained , you need an Administrator to add this Permission for you to be able to run the Command
I hope this helps!
Kindly mark the answer as Accepted and Upvote in case it helped!
Regards
-
Konstantinos Passadis 19,586 Reputation points MVP
2023-07-04T07:03:43.76+00:00 Hello @Mina !
You can probably use the Microsoft Teams Powershell Module
https://learn.microsoft.com/en-us/microsoftteams/teams-powershell-install
https://learn.microsoft.com/en-us/powershell/module/teams/?view=teams-ps
But i am not sure whether you can achieve the same command as it is more of an Administrative Tool
also you can try : Connect-MgGraph -Scopes "ChannelMessage.Read.All"
See if this allows you to read your team messages
I hope this helps!
Kindly mark the answer as Accepted and Upvote in case it helped!
Regards
-
Konstantinos Passadis 19,586 Reputation points MVP
2023-07-06T22:42:35.5333333+00:00 Hello @Mina !
Yes , exactly
I researched the whole issue , cannot find any other way to achieve that....
Talk to the Admin to provide Delegated Permissions for ChannelMessage.Read.All
In the meantime here are the instructions for the Filtering you mentioned earlier
https://learn.microsoft.com/en-us/graph/filter-query-parameter?tabs=powershell
I hope this helps!
Kindly mark the answer as Accepted and Upvote in case it helped!
Regards