r/PowerShell • u/Cautious_Jeweler_834 • Nov 17 '25
Question Connect Private Teams Channel
Hello techies,
I am trying to connect to Microsoft Teams using App Registration and Microsoft Graph API. I am successfully able to connect to Teams, I am getting private teams name and people who are part of that team and General channel. However my requirement is to get the details of people in private channel. I am getting 403 forbidden error.
I have given the following API permission
- Channel.ReadBasic.All
- ChannelMember.Read.All
- Directory.Read.All
- Group.Read.All
- Team.ReadBasic.All
- TeamMember.Read.All
- User.Read.All
Any inputs would be appreciated, Thanks
5
Upvotes
1
u/SherSlick Nov 17 '25
Subscribed as I never figured this out either.
1
u/BlackV Nov 17 '25
Have you granted that application access to the channel/team
1
u/cbrieeze Nov 18 '25 edited Nov 18 '25
ChannelMember.Read.Group ? are you doing it without a user or on behalf.
https://learn.microsoft.com/en-us/graph/api/channel-list-members?view=graph-rest-1.0&tabs=http#permissions
try running in https://developer.microsoft.com/en-us/graph/graph-explorer
ChannelMember.ReadWrite.All works for me
1
u/KavyaJune Nov 18 '25
For applications, you can try with ChannelMember.Read.Group permission. If you still face any error, you can try running this PowerShell script: https://o365reports.com/2024/01/09/export-microsoft-teams-private-channel-membership-reports-using-powershell/
The script uses Teams PowerShell module and exports detailed membership info of private channels.
1
u/Tachaeon Nov 18 '25
whats the use case for this?
0
u/raip Nov 17 '25
If I remember correctly, you also have to give the service principal the Teams Admin role for it to manage or look at the private groups it's not a member of.