I have created a custom site definition which I can see and create a site using my custom definition with the UI. However, if I try to create a site using powershell I get an error saying WARNING: Template is not found and is not applied.

I have verified that the Template param for New-SPWeb matches the definition name and configuration Id TestDefinition#0.

I looked at the available web templates using the command Get-SPWebTemplate and my new site definition is not showing up is not available in the collection. I do see other definitions created previously but not my new one.

Anyone have any ideas why I can't create a site this way?

1 Answer 1


This is a bit tricky, I must say. If you use Get-SPWebTemplate, I think you only get the built-in templates. If you want to find a custom site-template, you have to dance a little...

Here is what I have used, supplying the GUID along with name of the custom Site Template. Notice my $sitetemplatename - that last hash is part of the name; it isn't a comment. You put the GUID + # + name all together, just like that.

#You need to fish this out of SCA.  After you have saved the site template (with content), use the ps command in BGM's profile: listwebtemplates
$sitetemplateName = "{4755D494-88F9-4F59-909E-875F6D518A56}#MySiteTemplateName"

New-SPWeb -Url $SiteUrl -Name $SiteTitle -UniquePermissions:$true -Description $sitedescription
$currentWeb = Get-SPWeb $SiteUrl
write-host "Applying custom template..."
  • I think Mark asks for custom site definitions not web templates. Both should show in Get-SPWebTemplates provided the feature containing the templates are enabled. Check that the farm/site scoped feature with the site definition/web template are enabled Commented Jan 3, 2013 at 11:47
  • Thanks for your comment, Mr. Rask. I'd hate to confuse anyone besides myself!
    – bgmCoder
    Commented Jan 3, 2013 at 15:23
  • I'm interested to know if this was resolved. I have the same problem. @Anders Rask ... why would the feature be important? Aren't Site Definitions deployed as part of the package ... not a feature?
    – SteveCl
    Commented Aug 28, 2013 at 15:08

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.