Forum Discussion

affur5's avatar
affur5
Copper Contributor
Dec 15, 2022
Solved

How to create a Microsoft teams to an existing team site?

Hi there,

 

We have this team site and would like to connect/add an MS teams but there's no option/ button showing on our site to add/ create a MS teams

  • affur5 

    If your team site has a connected Office 365 Group then you can add a team using the teamify popup in the lower left corner of your site.
    If you already removed that popup, you can reactivate it using PNP Powershell

     

     

    Set-PnPPropertyBagValue -Key 'TeamifyHidden' -Value 'True'

     

     

     

    Or open Teams and select "Join or create a team" at the bottom. Then select "Create a Team" and then "from a group or team" and choose "Microsoft 365 Group".



    Alternatively you could use Microsoft Graph Explorer to create a team for your group.

    1) Get the group id of your team site (That would be the group with the same name as your site)

     

     

    GET https://graph.microsoft.com/v1.0/groups$filter=displayName%20eq%20'Example%20Group'

     

     


    2) And then add a Team to that group

     

     

    PUT https://graph.microsoft.com/v1.0/groups/{id}/team
    Content-type: application/json
    
    {  
      "memberSettings": {
        "allowCreatePrivateChannels": true,
        "allowCreateUpdateChannels": true
      },
      "messagingSettings": {
        "allowUserEditMessages": true,
        "allowUserDeleteMessages": true
      },
      "funSettings": {
        "allowGiphy": true,
        "giphyContentRating": "strict"
      }
    }

     

     

    (https://learn.microsoft.com/en-us/graph/api/team-put-teams?view=graph-rest-1.0&tabs=http)




    If you don't have a group connected team site (i.e. you created the team site from the admin center and choose to create a team site without a group), then you first need to create a group for that site.
    You can do that by 

     

    1. Selecting the little gear in the upper right corner
    2. Select "Connect to new Microsoft 365 Group"

     

    Or by using powershell and the  "Set-SPOSiteOffice365Group" SharePoint Powershell Command 

    (https://learn.microsoft.com/en-us/powershell/module/sharepoint-online/set-spositeoffice365group?view...)

    Set-SPOSiteOffice365Group -Site https://contoso.sharepoint.com/sites/classicsite -DisplayName "Classic Site" -Alias "classicsite"
  • SvenSieverding's avatar
    SvenSieverding
    Bronze Contributor

    affur5 

    If your team site has a connected Office 365 Group then you can add a team using the teamify popup in the lower left corner of your site.
    If you already removed that popup, you can reactivate it using PNP Powershell

     

     

    Set-PnPPropertyBagValue -Key 'TeamifyHidden' -Value 'True'

     

     

     

    Or open Teams and select "Join or create a team" at the bottom. Then select "Create a Team" and then "from a group or team" and choose "Microsoft 365 Group".



    Alternatively you could use Microsoft Graph Explorer to create a team for your group.

    1) Get the group id of your team site (That would be the group with the same name as your site)

     

     

    GET https://graph.microsoft.com/v1.0/groups$filter=displayName%20eq%20'Example%20Group'

     

     


    2) And then add a Team to that group

     

     

    PUT https://graph.microsoft.com/v1.0/groups/{id}/team
    Content-type: application/json
    
    {  
      "memberSettings": {
        "allowCreatePrivateChannels": true,
        "allowCreateUpdateChannels": true
      },
      "messagingSettings": {
        "allowUserEditMessages": true,
        "allowUserDeleteMessages": true
      },
      "funSettings": {
        "allowGiphy": true,
        "giphyContentRating": "strict"
      }
    }

     

     

    (https://learn.microsoft.com/en-us/graph/api/team-put-teams?view=graph-rest-1.0&tabs=http)




    If you don't have a group connected team site (i.e. you created the team site from the admin center and choose to create a team site without a group), then you first need to create a group for that site.
    You can do that by 

     

    1. Selecting the little gear in the upper right corner
    2. Select "Connect to new Microsoft 365 Group"

     

    Or by using powershell and the  "Set-SPOSiteOffice365Group" SharePoint Powershell Command 

    (https://learn.microsoft.com/en-us/powershell/module/sharepoint-online/set-spositeoffice365group?view...)

    Set-SPOSiteOffice365Group -Site https://contoso.sharepoint.com/sites/classicsite -DisplayName "Classic Site" -Alias "classicsite"

Resources