I recently ran into a rather unfortunate assignment. It regards the selection of pagelayouts and sitetemplates which subsites should be able to use.

As I'm supposed to change this for 20+ site collections, it will be quiet a mouthful, so I was wondering if there exists any way of programmatically handling this. All site collections have the same pagelayouts and sitetemplates installed, as we deployed the branding package containing these, globally a few days ago.

Could this be done through either a Farm feature, PowerShell, or even a Windows Application?


Yes, you can use powershell. The class is PublishingWeb in Microsoft.SharePoint.Publishing. It exposes various methods like SetAvailableWebTemplates, SetAvailablePageLayouts to acomplish the task.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy