Skip to content

Create site with STSADM using custom template from Site Template Gallery

May 17, 2011

The MSDN documentation of the Createweb STSADM operation suggests that it cannot use site templates that are uploaded to the site’s site template gallery:

Specifies the type of template to be used by the newly created site.

If you do not specify a template to use, the owner can choose a template when he or she first browses to the site.

The value must be in the form name#configuration. If you do not specify the configuration, (for example, STS) configuration 0 is the default (for example, STS#0).

The list of available templates can be customized to include templates you create. To display a list of custom templates, use the Enumtemplates operation.

Valid values available in a default installation include:

STS#0: Team Site
STS#1: Blank Site
STS#2: Document Workspace
MPS#0: Basic Meeting Workspace
MPS#1: Blank Meeting Workspace
MPS#2: Decision Meeting Workspace
MPS#3: Social Meeting Workspace
MPS#4: Multipage Meeting Workspace
BLOG#0: Blog
WIKI#0: Wiki Site

The sitetemplate parameter however can contain the name of a custom site template that is not in the central template gallery but in the site collection’s site template gallery.

stsadm -o createweb -url "http://server/site" -title "Title" -sitetemplate "MyTemplate.stp"

So don’t let yourself be mislead by the documentation…

Advertisements
Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: