Get-MSTTeamUser-Html
Teams: HTML report of users of a team
#Requires -Version 5.1
[CmdletBinding()]
Param(
[Parameter(Mandatory = $true)]
[string]$GroupId,
[ValidateSet('Member','Owner','Guest')]
[string]$Role
)
Process {
try {
[hashtable]$cmdArgs = @{'ErrorAction' = 'Stop'; 'GroupId' = $GroupId}
if (-not [System.String]::IsNullOrWhiteSpace($Role)) {
$cmdArgs.Add('Role', $Role)
}
$result = Get-TeamUser @cmdArgs | Select-Object Name, User, Role, UserID
if ($null -eq $result -or $result.Count -eq 0) {
Write-Output "No team users found"
return
}
Write-Output ($result | Sort-Object Name | ConvertTo-Html -Fragment)
}
catch { throw }
}GroupId of the team
Filter results to only users with the given role