question

VinodSurvase-1595 avatar image
0 Votes"
VinodSurvase-1595 asked SharonZhao-MSFT commented

How to create bulk teams via PowerShell is there any script if any do share?

How to create bulk teams via PowerShell is there any script if any do share?

office-teams-windows-itprooffice-teams-app-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

SharonZhao-MSFT avatar image
2 Votes"
SharonZhao-MSFT answered SharonZhao-MSFT commented

@VinodSurvase-1595,

I create a demo as below for reference:

  1. Create a TeamsInfo.csv file which contains TeamName, TeamDescription and Visibility and Owner as below. Save this file in c:\Temp\ TeamsInfo.csv.
    131729-image.png

  2. Connect to Microsoft Teams module:

    $User = admin@xxxx.onmicrosoft.com
    $PassWord = ConvertTo-SecureString -String "YourPassword" -AsPlainText -Force

    $UserCredential = New-Object -TypeName "System.Management.Automation.PSCredential" -ArgumentList $User, $PassWord

    import-module microsoftteams
    Connect-MicrosoftTeams -Credential $UserCredential -AccountId $User

  3. Add user as owner in bulk:

    $teams = import-csv c:\Temp\TeamsInfo.csv
    Foreach($team in $teams)
    {
    New-Team -DisplayName $team.TeamName -Owner $team.Owner -Description $team. TeamDescription -Visibility $team.Visibility
    }

As we are mainly responsible for general question of Microsoft Teams, script is not in our scope. So, I will add office-teams-app-dev tag for further help if possible.


If the response is helpful, please click "Accept Answer" and upvote it.

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.





image.png (10.3 KiB)
· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Please let us know if you have any query around this.

1 Vote 1 ·

@HunaidHanfee-MSFT , No query I got the answer for this.

1 Vote 1 ·

Thanks @SharonZhao-MSFT , appreciate your help.

0 Votes 0 ·

@VinodSurvase-1595,

Does this script work well?

If the suggestion helps, please be free to mark it as an answer for helping more people.

Have a nice day!

1 Vote 1 ·

Hi @SharonZhao-MSFT , Yes It was working well and helped a lot

0 Votes 0 ·
Show more comments