Commands › Microsoft Teams

Remove-TeamUser

Microsoft Teams MicrosoftTeams Remove-*

Remove an owner or member from a team, and from the unified group which backs the team.

Quick start script

# Remove-TeamUser — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-MicrosoftTeams -CertificateThumbprint $thumb -ApplicationId $appId -TenantId $tenantId

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-TeamUser
$before | Format-List

# 3. Make the change
Remove-TeamUser -GroupId <String> -Role <String> -User <String>

# 4. Verify and diff
$after = Get-TeamUser
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax

Remove-TeamUser -GroupId <String> -User <String> [-Role <String>] [<CommonParameters>]

Parameters (3)

ParameterTypeRequiredWhat it controls
-GroupId String yes GroupId of the team
-Role String yes If cmdlet is called with -Role parameter as "Owner", the specified user is removed as an owner of the team but stays as a team member.
-User String yes User's UPN (user principal name - e.g. johndoe@example.com)

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.