Friday, June 22, 2007

File or arguments not valid for site template

I was trying to use stsadm to create a SharePoint 2007 site collection using the createsiteinnewdb operation. I specified the site template name using the -sitetemplate switch but I kept getting the following error:

File or arguments not valid for site template [template name]

Here's the full command I was using:

stsadm -o createsiteinnewdb -url http://someurl/ -sitetemplate "publishing portal"

Turns out that silly me was supplying the template's display name and not its system name. So in order for the command to work correctly, I should have used "blankinternetcontainer#0" instead of "publishing portal". Where "blankinternetcontainer" is the name of the site definition and "0" is the configuration to be used.

stsadm -o createsiteinnewdb -url http://someurl/ -sitetemplate "blankinternetcontainer#0"

A quick way to get a list of template names is to navigate to the following page :http://website/_layouts/templatepick.aspx. Right-click on the page, view the source and pick out the name of the template from the values of the list items.


At 2:03 PM, Anonymous bb said...

Wow.. thanks for that templatepick.aspx tip... huge timesaver! :)

At 7:13 AM, Anonymous Kristina said...

Thanks for the tip! Worked great for me.

At 4:43 PM, Blogger Christian said...

The beauty of simplicity! Thanks for this.

At 4:33 AM, Anonymous Matt said...

Thank you that was a huge help

At 4:18 AM, Blogger wedward said...

Thanks! I was ready to shove a pencil in my eye over the right ID for a template...

At 9:48 PM, Blogger Bastiaan Kortenbout said...

I was able to reproduce this error, but it wasn't caused by using the "Display name" of the WebTemplate instead of the "Internal name". In my case, the error was caused because the webtemp*.xml file was missing in the following folder: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\1033\XML


Post a Comment

<< Home