CSOM + PowerShell: Setting Theme on Site

Standard

If you are looking to change the theme of your SharePoint 2013 and SharePoint Online site you can do this through CSOM.

Having connected to your environment you can run the below script that will change the theme to the Colour Palette to you have create ā€“ see this blog post on creating colour palettes

$web.ApplyTheme( “/_catalogs/theme/15/NewColourPalette.spcolor”, “/_catalogs/theme/15/NewFont.spfont”, “/_catalogs/theme/theme/15/BackGroundImage.jpg” , $True)
$web.update()
$ctx.Load($web)
$ctx.ExecuteQuery()

 

To see how to connect to your environment so the following blog post ā€“ Connecting to SharePoint Online through CSOM and PowerShell

CSOM-of-the-Day

Leave a Reply

Your email address will not be published. Required fields are marked *