Hello @ponthijr - You can use below command to get specific channel messages:
Import-Module Microsoft.Graph.Teams
Get-MgTeamChannelMessage -TeamId $teamId -ChannelId $channelId -Top 3
Please let me know if you need further assistance here.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am looking into how to grant Microsoft Graph access to retrieve specific channel information in Microsoft Teams.We are looking at ways to restrict access to specific channels. By default, I believe the (Team.ReadBasic.All, Channel.readBasic.All,ChannelMessage.Read.All) permission provides access to all channel messages. However, if we want to restrict access to specific channels, I have heard that this can be accomplished by requiring additional logic to be implemented within the application. Is there any way to filter the Graph API? to retrieve only messages from the required channels. Please tell me the specific command to use the filtering function using Graph API PowerShell.
Hello @ponthijr - You can use below command to get specific channel messages:
Import-Module Microsoft.Graph.Teams
Get-MgTeamChannelMessage -TeamId $teamId -ChannelId $channelId -Top 3
Please let me know if you need further assistance here.