Connect-SPOService -Url https://site-admin.sharepoint.com

$privateSites = Get-SPOSite | Where-Object -Property Template -eq "TEAMCHANNEL#0"

Any attempt to get the list of members for a private site returns with Access Denied.

Is there any way to do this in PowerShell?

Not familiar at all with graph API.

  • Did you try running this command with Global administrator or SharePoint tenant administrator roles? Jun 30 at 17:26

To get Get members of a private channel in Microsoft Teams, try running below command with administrative privileges:

Get-SPOUser -Site https://tenant.sharepoint.com/sites/SiteName | select * | Format-table -Wrap -AutoSize 

Documentation: Manage SharePoint Online users and groups with PowerShell

To get users from Group Site Collections in a tenant, use:

Get-SPOSite -Template GROUP#0 | ForEach {Get-SPOUser -Site $_.Url}

Documentation: Get-SPOSite

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.