Articles on: Scripts

Remove team member from the Microsoft Teams


This script is used to remove members and owners in Teams

The following columns are required in the CSV:

-GroupID: GroupID of the Team

-User: Email of the user

-Role: Owner or members 

Note: If you remove an owner from a team he will still be a member of the Team


Install-Module -Name MicrosoftTeams


Import-Csv -Path " C:\Users\Awais\OneDrive - Communication Square\Desktop\teams.csv" | foreach


Remove-TeamUser -GroupId $_.GROUPID -User $_.upn -Role $_.Role


Updated on: 31/01/2023

Was this article helpful?

Share your feedback


Thank you!