Hi everyone,
I am trying to figure out how to use PowerShell to search for the guest users I have inside my Microsoft Teams. When I run the following:
Get-Team -User first.last@company.com | Select GroupId
I get the Group Id for all teams that I am in, listed like so (dummy values):
61e72e0d-eb48-4eq9-b02a-6a29420e9d4f
9q4b769l-16bb-4040-a740-4208ce9a61f9
aca41337-fc87-4fdb-9a2d-b14276a514c6
Next, I can run:
Get-TeamUser -GroupId 61e72e0d-eb48-4eq9-b02a-6a29420e9d4f -Role Guest
to see all the guests within an individual group. When I run the following:
Get-Team -User first.last@company.com | Select GroupId | Get-TeamUser -GroupId $_ -Role Guest
I get the error:
Cannot bind argument to parameter 'GroupId' because it is null.
I also tried
Get-Team -User first.last@company.com
ForEach-Object {
$_ | Get-TeamUser
}
and get the error:
Get-TeamUser : The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the
parameters that take pipeline input.
Any suggestions? Thank you very much!