Thursday, April 27, 2017

SharePoint and PowerShell: Get all Site Collections by Template

With this script you can check your farm for all site collections using a defined template, in my example it is the community site.
Community Site(COMMUNITY#0, 62)
Community Portal(COMMUNITYPORTAL#0, 63)
Community Area Template (SPSCOMMU#0, 36)

How did I get the web template id?
$web = Get-SPWeb http://domain/site/yourcommunitysite
Write-Host "Template:" $web.WebTemplate " |ID:" $web.WebTemplateId


  1. Thank you for sharing the script, I'll try to apply it to my site code, and to integrate if necessary. But while this business will wait, (I mean the development of the site) because now I was asked by friends from the football team to make a presentation and motivational speech. So I'll have to show diligence) But honestly, I already found templates for the presentation and chose from them the most suitable and bright in my opinion. I think it will be appropriate.

  2. Very helpful suggestions that help in the optimizing website. Thank you for valuable suggestions.Powershell Studio 2017