I want to set New Page Default Settings to "Inherit default page layout from parent site" in sharepoint 2013 subsites using powershell script. I have tried with publishing-web IsInheritingDefaultPageLayout property but it is read-only property.This can be done manually via SharePoint GUI (Site Settings / Look and Feel / Page Layouts and site templates) but i want to do this settings using powershell script.Is there any solution?
1 Answer
Done with below code.
Use InheritDefaultPageLayout
method instead of IsInheritingDefaultPageLayout
property.
$pweb = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($subsite)
$pweb.InheritDefaultPageLayout();
$pWeb.Update();