As stated in a previous post, you can manage only a few settings regarding Teams Templates from the UI. Instead, we could use PowerShell to update template settings after creation or create a template with the preferred settings from the get-go. PowerShell is also helpful to copy a template and create a new one, for instance, in multilingual scenarios with different locales.
Install the Microsoft Teams PowerShell Module and then connect to the Teams Admin center
Install-Module -Name MicrosoftTeamsConnect-MicrosoftTeams
You can read more about the MicrosoftTeamsPowerShell Module over at Microsoft Docs
You could use the following cmdlets to manage your templates in PowerShell.
Using the command as is, prints all OdataId*. If you want to see some more properties, you could pipe Format-List** at the end.
Get-CsTeamTemplateList | Format-List
The edit settings from the UI are as limited as to when we created the template. For example, we could change the name, short and long description, modify channels and apps.
We can change all of the above via PowerShell and also:
Depending on your organization’s requirements, you might want to limit what team members can do. For example, we could leave the channel management to team owners and disable the option for members. This way, members are not hindered and can still be productive. Without teams templates or any other custom solutions, every team would have to be changed manually from the Team Settings. Let’s change the template to disable channel management for members. First, get the template and output it to a .json file.
(Get-CsTeamTemplate -OdataId "/api/teamtemplates/v1.0/a4e03348-39cd-42c7-9035-8c4439b55a21/Tenant/en-US") > input.json
Open the file in VS Code and make some changes, then run the update cmdlet.
Update-CsTeamTemplate -OdataId "/api/teamtemplates/v1.0/a4e03348-39cd-42c7-9035-8c4439b55a21/Tenant/en-US" -Body (Get-Content '.\input.json' | Out-String)
Now, if we create a team based on the template, we get the team settings we want:
The easiest way to create a custom template is to copy an existing one and change the settings, just as we did in the update scenario.
(Get-CsTeamTemplate -OdataId "/api/teamtemplates/v1.0/a4e03348-39cd-42c7-9035-8c4439b55a21/Tenant/en-US") > input.jsonNew-CsTeamTemplate -OdataId "/api/teamtemplates/v1.0/a4e03348-39cd-42c7-9035-8c4439b55a21/Tenant/en-US" -Body (Get-Content '.\input.json' | Out-String)
IMPORTANT! Microsoft uses the Category property to categorize the pre-made templates. If you clone from a base template, you need to set the Category to $null
There are a few other ways you can read about in the documentation for the cmdlet.
This was a concise post on the benefits of using PowerShell for managing Teams templates. Unfortunately, you cannot create Template Policies via PowerShell; you are stuck with the UI.
Thanks for reading