Using PowerShell to apply master page and logo settings to all sites in a farm
For this recipe, we are using a PowerShell script to apply master page and logo settings to each SharePoint site in every site collection of each web application on the local SharePoint farm.
How to do it...
Follow these steps to apply master page and logo settings to all sites in the local SharePoint farm using PowerShell:
- Open your preferred text editor to create the
.ps1
script file. - Use a
foreach
loop to iterate through each content ofSPWebApplication
on the local SharePoint farm using theGet-SPWebApplication
Cmdlet:foreach($webApp in (Get-SPWebApplication))
- Use a
foreach
loop to iterate through eachSPSite
in theSites
property of theSPWebApplication
object:
Get SharePoint 2013 WCM Advanced Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.