How to use PowerShell to set the Master Page in SharePoint 2010

The master page setting is scoped at the web level, so the first thing I did was use Get-SPWeb to get a variable for the web I want to change. There are two properties that control the master page settings; MasterUrl and CustomMasterUrl. The former controls the master page used to render the System pages (the ones that start with /_layouts) and the latter controls the master page used to render the content pages. This picture helps explain it better:

Continue reading “How to use PowerShell to set the Master Page in SharePoint 2010”

Advertisements

Read / Fetch / Retrieve data from SharePoint list programmatically using caml query

Quick and Easy, just make sure to type the exact name of the Lists \ Libraries inside the code: