Hello everyone,
I recently needed to show to a client that he had lost control of the number of « external » teams he has and all the guests he had too.
I didn’t need to export the output, just to show him on the screen so the script I’m gonna show you is pretty simple and is can be optimized by exporting a clean output to a CSV or XML.
$Teams = Get-Team
foreach ($Team in $Teams) {
$Guests = Get-TeamUser -GroupID $Team.groupId | Where-Object {$_.Role -eq "Guest"}
Write-Output "Team : $($Team.DisplayName)"
Write-Output "Members : "
$Guests
}


Votre commentaire