CmdID / PowerShell / Cmdlets / Get
Get-SharedWithTeamUser
This cmdlet supports retrieving users of a shared with team. Microsoft Teams PowerShell reference
From the Microsoft Teams PowerShell reference 4 parameters Its page in the reference
Parameters
-ChannelIdThread ID of the shared channel.-HostTeamIdTeam ID of the host team (Group ID).-RoleFilters the results to only users with the given role of "Owner" or "Member".-SharedWithTeamIdTeam ID of the shared with team.