How do I – Identify the SharePoint site template type and ID of a given sub web?

Written by Cornelius J. van Dyk on . Posted in How Do I...

This one always comes up at some point in time, especially after migrations. I’ve seen issues with migrated sites many times when custom site templates were used for sites, since SharePoint doesn’t know how to upgrade these sites 100%. A good example is the Fab40 templates that people loved to install in SharePoint 2007. When migrating to 2010, the templates are not supported and if the templates were not installed on the target server, issues will arise with the sites. The most common of these are that the home pages will simply throw a 404 error. You can navigate through the site settings pages just fine, but the home pages just doesn’t work. For this reason, I always start my trouble shooting by asking what type of site I’m dealing with. Since it’s most unlikely that your site admin would know in most cases, it becomes necessary to be able to identify that. Here’s a quick Powershell script for doing so.

$web = Get-SPWeb " Algorithms"
write-host "Template Name: " $web.WebTemplate
write-host "Template ID: " $web.WebTemplateId
NOTE:  The URL supplied to Get-SPWeb should be in quotes and should NOT contain unescaped characters i.e. will NOT yield a valid SPWeb object, but “ Algorithms” will.



Tags: , ,

Trackback from your site.

Cornelius J. van Dyk

Born and raised in South Africa during the 70's I got my start in computers when a game on my Sinclair ZX Spectrum crashed, revealing it's BASIC source code. The ZX had a whopping 48K of memory which was considered to be a lot in the Commodore Vic20 era, but more importantly, it had BASIC built into the soft touch keyboard. Teaching myself to program, I coded my first commercial program at age 15.

After graduating high school at 17, I joined the South African Air Force, graduating the Academy and becoming a Pilot with the rank of First Lieutenant by age 20. After serving my country for six years, I made my way back into computer software.

Continuing my education, I graduated Suma Cum Laude from the Computer Training Institute before joining First National Bank where my work won the Smithsonian Award for Technological Innovation in the field of Banking and Insurance. Soon I met Will Coleman from Amdahl SA, who introduced me to a little known programming language named Huron/ObjectStar. As fate would have it, this unknown language and Y2K brought me to the USA in 1998.

I got involved with SharePoint after playing around with the Beta for SharePoint Portal Server 2003. Leaving my career at Rexnord to become a consultant in 2004, I was first awarded the Microsoft Most Valuable Professional Award for SharePoint in 2005, becoming only the 9th MVP for WSS at the time. I fulfilled a life long dream by pledging allegiance to the Flag as a US citizen in 2006. I met the love of my life and became a private consultant in 2008. I was honored to receive my ninth MVP award for SharePoint Server in 2013.

Leave a comment

You must be logged in to post a comment.