Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

-sitetemplate parameter in the context of stsadm -o createweb

  Asked By: Rikki    Date: Jun 10    Category: Sharepoint    Views: 2102

I have created a custom .stp and want to create sites using that
template with the stsadm command line interface.
My question is how do I reference the -sitetemplate parameter for that
I tried using the template name and it didn't work..
Any ideas?



1 Answer Found

Answer #1    Answered By: Debbie Snow     Answered On: Jun 10

I did some playing around with this.

So, when you save the site as a template, it asks you for both a
filename and a Title.

When you do this is looks like it just puts it in the Site Template
Gallery for the site collection, but doesn't install it on the farm.

I was not able to use the stsadm  command to create  webs of this type.
I'm guessing it requires it to be install at the farm level.

So, I then just went to the site template  gallery (/_catalogs/wt),
clicked on my custom  template, and saved it as an .stp file.

Then I used the following command  to install the template:
stsadm -o addtemplate -filename MyCustomSiteTemplate.stp -title "My
Custom Site Template"

then a quick iisreset. This installs it at the farm level and allows
you to create sites  of this type from any sitecollection AND allows the
stsadm commands to work.

You can then reference  them by title or filename.

I then issued the following two commands that both worked:
stsadm -o createweb  -url http://myspsite/cs1 -sitetemplate
stsadm -o createweb -url http://myspsite/cs2 -sitetemplate  "My Custom
Site Template"