How to Change Page layout of publishing pages in Sharepoint 2013 using powershell?
Hello Sharepointers, Below are the powershell script to update the pagelayout of all the publishing page in a sharepoint site collection. $spWeb = Get-SPWeb(“http://yoursitecollection/yoursite”) $pWeb = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($spWeb) $pSite = New-Object Microsoft.SharePoint.Publishing.PublishingSite($spWeb.Site); $siteLayouts = $pSite.GetPageLayouts($false) $myLayout = $siteLayouts[“/_catalogs/masterpage/custompagelayout.aspx”] #$myLayout $query = New-Object Microsoft.SharePoint.SPQuery $query.ViewAttributes = “Scope=’RecursiveAll’” $pages = $pWeb.GetPublishingPages($query) foreach ($page in $pages) { if ($page.ContentType.Name […]