function ApplyMasterPageToSearchSite([string] $siteURL, [string] $SiteName)
{
$subsiteurl = $siteURL + "/" + $SiteName + "/default.aspx"
Enable-SPFeature -identity "94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb" -url $subsiteurl
Start-SPAssignment -Global
$site = Get-SPSite $siteURL
Write-Host "Get the Site" -foregroundcolor green
$topWeb = Get-SPWeb $site.Url
Write-Host "Update Master Page to search" -foregroundcolor green
$site | Get-SPWeb -limit all | ForEach-Object { $_.MasterUrl = "/_catalogs/masterpage/LMSSearchMaster.master";$_.Update() }
Write-Host "Master Page assigned" -foregroundcolor green
Stop-SPAssignment -Global
$site.Dispose()
}
{
$subsiteurl = $siteURL + "/" + $SiteName + "/default.aspx"
Enable-SPFeature -identity "94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb" -url $subsiteurl
Start-SPAssignment -Global
$site = Get-SPSite $siteURL
Write-Host "Get the Site" -foregroundcolor green
$topWeb = Get-SPWeb $site.Url
Write-Host "Update Master Page to search" -foregroundcolor green
$site | Get-SPWeb -limit all | ForEach-Object { $_.MasterUrl = "/_catalogs/masterpage/LMSSearchMaster.master";$_.Update() }
Write-Host "Master Page assigned" -foregroundcolor green
Stop-SPAssignment -Global
$site.Dispose()
}
Comments
Post a Comment