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.
6 Comments:
Wow.. thanks for that templatepick.aspx tip... huge timesaver! :)
Thanks for the tip! Worked great for me.
The beauty of simplicity! Thanks for this.
Thank you that was a huge help
Thanks! I was ready to shove a pencil in my eye over the right ID for a template...
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