Create team using Powershell

Marian Hercek 236 Reputation points
2020-10-05T11:40:03.817+00:00

Cannot find a way to create a team:

  • from a group (-GroupId parameter)
  • using a template (-Template parameter)
  • setting visibility (-Visibility parameter)

This combination parameters are not supported for New-Team cmdlet (even in 1.1.6 Microsoft Teams Powershell module).

Why?
All those settings are supported via GUI (i.e. Microsoft Teams client for Windows, version 1.3)

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

Accepted answer
  1. Leon Laude 85,666 Reputation points
    2020-10-05T12:07:43.973+00:00

    Hi @Marian Hercek ,

    Here's an example on how to create a new team from a GroupId:

    Install-Module MicrosoftTeams -Force  
    Connect-MicrosoftTeams  
    $SiteObj = Get-SPOSite -Identity $SiteURL.SiteURL  
    New-Team -GroupId $SiteObj.GroupId.Guid  
    

    Regarding the -Template parameter, read the following:

    IMPORTANT: Using this cmdlet to create a new team using a template is still in preview. You can install and use the preview module from the PowerShell test gallery. For instructions on installing and using the Teams PowerShell preview module, see Install the pre-release version of the Teams PowerShell module.

    Reference:
    https://learn.microsoft.com/en-us/powershell/module/teams/New-Team?view=teams-ps

    Here's an example on how to use the -Visibility parameter:

    New-Team -DisplayName "Dev Team" -Description "Team for Development" -Visibility Public  
    

    or

    $Team = New-Team -DisplayName "Dev Team"  
    Set-Team -GroupId $Team.GroupId -Visibility Private  
    

    ----------

    (If the reply was helpful please don't forget to upvote or accept as answer, thank you)

    Best regards,
    Leon


3 additional answers

Sort by: Most helpful
  1. Sharon Zhao-MSFT 25,056 Reputation points Microsoft Vendor
    2020-10-06T02:55:55.477+00:00

    @Marian Hercek ,

    You can create a team from existing Office 365 group by the id of the group:

    New-Team -GroupId "Existing Group ID - GUID"  
    

    In this scenario, you cannot provide the group related values that are already specified in the existing group, such as Visibility, Alias, Description, or DisplayName.

    As Leon Laude said, the Template parameter is used to set the type of Education Team in the New-Team cmdlet.


    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.


  2. Marian Hercek 236 Reputation points
    2020-10-07T03:40:26.147+00:00

    What kind/template of Team is created by default (in EDU tenant). How do I find it out?
    I can see four kinds/templates: Class, PLC, Staff, Other.


  3. NK-8552 1 Reputation point
    2021-03-31T15:13:38.247+00:00

    It seems like there are only 2 parameters available in Teams cmdlet under -template switch. Is it powerShell limitation or tenant limitation? I'm sure in GUI we should be able to create all 4 types as shown in image shared above by @Sharon Zhao-MSFT . This is what I get in PowerShell ISE when I checked for template parameters:

    83353-image.png

    0 comments No comments