we had a web application which for each project create a site collection with a template in it. we had just one content database which uses it for all site collections in SharePoint 2007 we used the below command to create each web application

 stsadm -o gl-createsiteindb -url http://spsrv01:7000/tdd/205164
 -owneremail [email protected] -ownerlogin medianet\spsadmin -secondaryemail [email protected]  -secondarylogin medianet\spsiteadmin -sitetemplate "TDDCont" -title "Temp Project
 Data" -dbname TDD_ContentDB

but it does not work in SharePoint 2010 after upgrading from 2007 to 2010 and I get the below error is there any differences in stsadm command for SharePoint 2010 and SharePoint 2007 what should I do

enter image description here

1 Answer 1


First be aware of the name after -o is the operation name and The error that you have got mean that this name is invalid or missing.

After long search, I found out that this gl-createsiteindb has been fixed to work with SP2 as mentioned at recent-custom-stsadm-extensions-bug-fixes

He also introduces a workaround to do that as the following :

Once you get the SPContentDatabase object you can simply use the Sites property which returns an SPSiteCollection object and then call it’s Add method to add the site to the database – seems so obvious now.

I also advise you to create a site collection with a custom template via the following script :

    $web = get-spweb https://sharepoint
$template = $web.GetAvailableWebTemplates(1033) | Where-Object {$_.Title -eq “<Custom Templete Title>”}
Write-Host $template.Name
New-SPWeb -Url “https://sharepoint/newsubsite” -Template “{D839E38A-F9DF-4B35-BDA7-A1E273C51EAB}#XXXX Template”

Add-PSSnapin Microsoft.Sharepoint.Powershell
$web = get-spweb https://sharepoint
$template = $web.GetAvailableWebTemplates(1033) | Where-Object {$_.Title -eq “<Custom Templete Title>”}
$newweb = New-SPWeb -Url “https://sharepoint/newsubsite” 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.