magritton
10/7/2016 - 7:20 PM

This SharePoint Powershell script checks all of the web sites in a site collection and web application for a specific web template that is u

This SharePoint Powershell script checks all of the web sites in a site collection and web application for a specific web template that is used.

$webApplicationName = "https://xxxx"
$cnt = 0
$path = "f:\temp\webTemplates.txt"

$wa = Get-SPWebApplication $webApplicationName

foreach($site in $wa.Sites)
{
    $site.Url
    foreach ($web in $site.AllWebs) 
    {
	$web.Url
	if($web.WebTemplate -like "HOMEPORTNWPROJ"){
		$web.Url | out-file $path -append
	}
    }#end foreach web
}#end for each site