Create Class Teams group in Bulk

IBN 4,416 Reputation points
2022-07-12T08:32:37.66+00:00

Hello

Please i need a help on this.

I would like to know if there's a way of creating teams groups in bulk, with Owner, Class Type, Team Name and Members?

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

2 answers

Sort by: Most helpful
  1. Kael Yao-MSFT 37,656 Reputation points Microsoft Vendor
    2022-07-13T01:52:49.73+00:00

    Hi @IBN

    First you may need to prepare a csv file which contains Owner, Class Type, Team Name and Members.
    For example it may look like:
    220214-09.png

    Then connect to Teams Powershell and run the following script:

    $Teams = import-csv C:\Scripts\Teams\bulk.csv  
    Foreach($Team in $Teams)  
    {  
    	$Group = New-Team -DisplayName $Team.TeamName -Owner $Team.Owner -Visibility $Team.Type  
    	$Members = $Team.Members.Split(",")  
    	Foreach($Member in $Members)  
    	{	  
    		Add-TeamUser -GroupId $Group.GroupId -User $Member  
    	}  
    }  
    

    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.


  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.