bulk deleting multiple members from teams

RUQAIA MOHAMMED MALIK AL RAJHI 21 Reputation points
2022-06-20T20:06:47.433+00:00

how can I bulk deleting multiple members from teams
just like adding by Refined Microsoft Teams? # Heading

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,062 questions
0 comments No comments
{count} votes

Accepted answer
  1. Kael Yao-MSFT 37,496 Reputation points Microsoft Vendor
    2022-06-21T01:59:32.773+00:00

    Hi @RUQAIA MOHAMMED MALIK AL RAJHI

    I suppose it can be done with Teams Powershell.

    You may need a csv file which contains the users' UPNs to be removed.

    The format would be like:
    UserPrincipleName
    user01@Company portal .com
    user02@Company portal .com
    user03@Company portal .com

    Then you may connect to Teams Powershell(install Teams module in Powershell and run Connect-MicrosoftTeams) as Team owner or Teams admin and run the following cmdlets.
    First get the groupID of the Team:

    Get-Team -DisplayName "Team Name"  
    

    Then remove members from the Team:

    import-csv 01.csv | foreach{Remove-Teamuser -GroupID <GroupID from the above cmdlet> -User $_.UserPrinciplename}  
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful