Closed beigewell closed 1 month ago
Thanks. Will update the script
Actually, the script looks for ChannelMessage.ReadWrite, which is one of the scope permissions listed. Maybe your session didn't have this permission?
it did have this permission as you can see above in the script output it lists I have Scopes on the request 'APIConnectors.Read.All, AuditLog.Read.All, ChannelMessage.ReadWrite, ChannelSettings.Read.All,
I admit it is weird as you would think that would give Read as well, but as soon as I added ChannelMessage.Read.All to the scope the error fixes itself
Another Graph mystery...
Additional API permission required on line 22 ChannelMessage.Read.All
Connect-MgGraph -NoWelcome -Scopes ChannelMessage.ReadWrite, Team.ReadBasic.All, TeamMember.Read.All, ChannelSettings.Read.All, ChannelMessage.Read.All
When running the script without -silentlycontinue shows this error
PS C:\temp> $ChannelMessages = Get-MgTeamChannelMessage -TeamId $Team.Id -ChannelId $SelectedChannel.Id -PageSize 50 -All Get-MgTeamChannelMessage : Missing scope permissions on the request. API requires one of 'ChannelMessage.Read.All'. Scopes on the request 'APIConnectors.Read.All, AuditLog.Read.All, ChannelMessage.ReadWrite, ChannelSettings.Read.All, Chat.Create, Chat.Read, Chat.ReadBasic, Chat.ReadWrite, ChatMessage.Read, ChatMessage.Send, Directory.AccessAsUser.All, Directory.Read.All, openid, Policy.Read.All, profile, RoleManagement.Read.Directory, Team.ReadBasic.All, TeamMember.Read.All, User.Read, User.Read.All, UserAuthenticationMethod.Read.All, email' Status: 403 (Forbidden)