In this post, we will discuss how we can get a list of pages that are using a particular page layout in SharePoint 2013 using PowerShell. Recently while working on a moss 2007 to SharePoint 2013 migration project we got a scenario where we need to find out the page names from a document library which is using a particular page layout.
Below is the PowerShell script.
$site = get-SPSite http://win-pfcp2dgt8di/sites/EnjoySharePoint/
$web = $site.RootWeb
$pweb = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($web)
$pPages = $pWeb.GetPublishingPages();
$pLayouts =”ErrorLayout.aspx” #$pweb.GetAvailablePageLayouts()
foreach ($pPage in $pPages)
if ($pPage.Layout.Name -eq $pLayouts)
Hope this will be helpful.
Download FREE SharePoint 2019 Installation PDF Guide
This FREE PDF contains, Steps by step guide to install SharePoint 2019 Preview, prerequisites, hardware and software new features. First impression to SharePoint Server 2019 new modern site, modern lists and modern document libraries.
You May Also like the Following SharePoint Online Tutorials: