Create Team and Channels with PowerShell

Posted by erwin on Friday, April 12, 2019


Create Team and Channels with Powershell

Creating multiple Teams within Microsoft Teams can be a immense process and time-consuming, but you can easily create your Teams with the use of PowerShell. If you dont have installed the Microsoft Teams PowerShell Module follow this link.

The Code

    $TeamName = "Contoso"
    $TeamDescription = "Contoso is a fictional company used by Microsoft as an example company and domain."
    $TeamVisability = "Public" #Public or Private
    $TeamOwner = ""


    $group = New-Team -DisplayName "$TeamName" -Description "$TeamDescription" -AccessType "$TeamVisability"

    Add-TeamUser -GroupId $group.GroupId -User "$TeamOwner" -Role "owner"

    New-TeamChannel -GroupId $group.GroupId -DisplayName "Sales"
    New-TeamChannel -GroupId $group.GroupId -DisplayName "Marketing"
    New-TeamChannel -GroupId $group.GroupId -DisplayName "Security"

comments powered by Disqus