List Aggregator App (SPFx)

Get list of pages using a particular page layout using PowerShell in SharePoint 2013

This SharePoint 2013 tutorial explain, 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 in SharePoint 2013.

SharePoint deveopment training course

Below is the PowerShell script to get the list of pages using a particular page layout using PowerShell in SharePoint 2013.

Add-PSSnapin “Microsoft.SharePoint.PowerShell”
$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)
{
write-host $pPage.Title
}
}


You may like following SharePoint page layouts tutorials:

Hope this will be helpful to get list of pages using a particular page layout using PowerShell in SharePoint 2013

Check out Best Alternative to InfoPath -> Try Now

free sharepoint training

SharePoint Online FREE Training

JOIN a FREE SharePoint Video Course (3 Part Video Series)

envelope
envelope

About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

View all posts by Bijay Kumar →