M365 Teams Template error

Patterson River Secondary College

M365 Teams Template error

After creating a Teams Template we noticed some newly created templates had disappeared from Teams Admin Centre. We used Powershell to verify and check the Templates were missing by issuing the following commands.

First we connect to Teams powershell by using the following command
Connect-MicrosoftTeams

We then checked the list of Teams templates by using the following command –
Get-CsTeamTemplateList

We verified the missing teams from Teams Admin Centre were appearing in Powershell so we exported them using the following command –
(Get-CsTeamTemplate -OdataId ‘/api/teamtemplates/v1.0/**InsertTeamsTemplateID**/Public/en-US’) > inputTemplate.json
Where **Insert TeamsTemplateID** is in the file name, add the ID of the actual team template you want to view.

We then opened the template in notepad and compared it with a visible Teams Template and noticed the following lines was missing.

We copied the missing lines across to the non visible template, saved it as inputEdited.json and uploaded it as a new template using the following command.
New-CsTeamTemplate -Locale en-US -Body (Get-Content ‘c:\dump\inputEdited.json’ | Out-String)

This fixed the issue and the template was now visible in Teams Admin Centre.

We then went back and tidied up by removing the old non visible teams template by using –
Remove-CsTeamTemplate -OdataId ‘/api/teamtemplates/v1.0/**OldTeamsTemplateID**/Tenant/en-US’