Adding SharePoint Site Template to Team Foundation Server

In order to add custom SharePoint site template we need to use SharePoint command line utility called stsadm with the following signature
stsadm –o addtemplate –filename template.stp –title templateTitle

This option allows for very flexible way of adding custom designed site templates. Once site template is added, you can use it with the Team Foundation Server’s process template.

It is very important to restart IIS Services after installing template by using iisreset command line or you may restart the server.

In order to specify site template we are planning to use in TFS we need to set XML Site element this way
<site template="" language=""/>


    Attribute    Description
template Specifies which template to use. The template is a combination of the template name and configuration id from the webtemp.xml file on the SharePoint server.
language Specifies a locale id to indicate which language version of the site template to use. The English version is 1033.

Here is complete example of XML node
<task id="SharePointPortal" name="Create Sharepoint Portal" plugin="Microsoft.ProjectCreationWizard.Portal" completionMessage="Project site created.">
            <site template="VSTS_MSFAgile" language="1033"/>…

After adding Site Template to Team Foundation Server, we need to add this template to our Process Template. In order to do that, we need to run command line to get all the names of all Site Templates for the final step of adding Site Template to our Process Template.
stsadm -o enumtemplates

For instance, the name of our Site Template is _MyTemplate_. We need to remember this information for our next and final step. Open up file called WSSTasks.xml from our TFS Process Template and modify following XML node in it
<site template="_MyTemplate_" language="1033"/>

Upload this Process Template back to our Team Foundation Server and we are done.

Featured pages

SharePoint Integration

Windows SharePoint Services is an integral part of Team Foundation Server. As a result, there is v…

Creating Team Project

Team Foundation Server allows creation of the portal project via TFS Portal Creation Wizard. This …

SQL Server Agent Jobs

Team Foundation Server installs several SQL Server Agent Jobs that allow it to perform certain tas…

tf Command

tf Command line utility provide many useful operations that we can perform with Team Foundation Se…

Shelving and Unshelving

Shelving is very powerful feature of the Source Control in VSTS that allows storing pending change…

MS Project Fields Mapping

TFS works with MS Project via mapping file with specific fields mapped from one application to ano…

Using MS Project with Team Foundation Server

MS Projects allows accessing Team Foundation Server and working with the TFS Work Items. This is a…

Managing Documents in TFS

Team Foundation Server provides us with the capability to manage various documents, also called ar…