Wednesday, January 13, 2016

Apply page layout for a particular page in SharePoint 2013 using PowerShell

In this article we will see how to apply page layout for a particular page in SharePoint 2013 using PowerShell,

$spWeb = Get-SPWeb("https://server.com/sites/MyWeb")
$spFile = $spWeb.GetFile("https://server.com/sites/Pages/MyPage.aspx")
$spFile.CheckOut("Online",$null)
$spFile.Properties["PublishingPageLayout"] = "/sites/_catalogs/masterpage/PageLayout.aspx"
$spFile.Update()
$spFile.CheckIn("Update page layout via PowerShell",[Microsoft.SharePoint.SPCheckinType]::MajorCheckIn)
$spWeb.Dispose()

Hope this helps!

Populate people picker field with logged in user in SharePoint using JS

Please use below code to populate people picker in SharePoint online, <script src="https://ajax.googleapis.com/ajax/libs/jquery/3....