Skip to content
Rishan Solutions
Rishan Solutions
  • PowerApps
  • SharePoint online
    • Uncategorized
    • Uncategorized
  • PowerAutomate
Rishan Solutions
Latest Posts
  • Agentic AI: The Dawn of Autonomous Intelligence Revolutionizing 2025 June 24, 2025
  • Recursive Queries in T-SQL May 7, 2025
  • Generating Test Data with CROSS JOIN May 7, 2025
  • Working with Hierarchical Data May 7, 2025
  • Using TRY_CAST vs CAST May 7, 2025
  • Dynamic SQL Execution with sp_executesql May 7, 2025

Applying Branding to Multiple Sites using PnP PowerShell

Posted on March 19, 2025March 19, 2025 by Rishan Solutions

Loading

Branding in SharePoint Online ensures visual consistency, improved user experience, and better corporate identity across multiple sites. Using PnP PowerShell, administrators can efficiently apply themes, logos, headers, and footers to multiple SharePoint sites.

Why use PnP PowerShell for Branding?

  • Automates theme application across multiple sites
  • Saves time compared to manual configuration
  • Ensures consistent branding across an organization

Prerequisites

Before running PnP PowerShell commands:

Install PnP PowerShell (if not installed)

Install-Module -Name PnP.PowerShell -Force -AllowClobber

Connect to SharePoint Online

Connect-PnPOnline -Url "https://yourtenant-admin.sharepoint.com" -Interactive

Ensure permissions

  • You must be a SharePoint Admin or Site Owner

Step 1: Apply a Custom Theme

To apply a custom theme across multiple sites, first, define the theme in a JSON file.

Example: JSON Theme File (custom-theme.json)

{
"palette": {
"themePrimary": "#0078d4",
"themeSecondary": "#2b88d8",
"themeTertiary": "#71afe5",
"themeDarkAlt": "#106ebe",
"themeDark": "#005a9e"
},
"isInverted": false,
"name": "Company Theme"
}

✔️ Save the JSON file as custom-theme.json.

Upload and apply the theme using PowerShell

$themeJson = Get-Content -Raw -Path "C:\custom-theme.json"
Add-PnPTenantTheme -Identity "Company Theme" -PaletteJson $themeJson -IsInverted $false

Adds the theme to the SharePoint Tenant.

Apply the theme to multiple sites

$sites = @("https://yourtenant.sharepoint.com/sites/Site1",
"https://yourtenant.sharepoint.com/sites/Site2")

foreach ($site in $sites) {
Connect-PnPOnline -Url $site -Interactive
Set-PnPWebTheme -Theme "Company Theme"
}

Applies the Company Theme to all listed sites.


Step 2: Set a Custom Logo

To set a site logo for multiple sites:

$sites = @("https://yourtenant.sharepoint.com/sites/Site1",
"https://yourtenant.sharepoint.com/sites/Site2")

foreach ($site in $sites) {
Connect-PnPOnline -Url $site -Interactive
Set-PnPWeb -SiteLogoUrl "https://yourtenant.sharepoint.com/sites/branding/logo.png"
}

Updates the logo for all specified sites.


Step 3: Configure the Header Layout

To change the site header style (e.g., compact, standard, extended, minimal):

Set-PnPWeb -HeaderLayout Extended

Sets the Extended Header layout.

For multiple sites:

$sites = @("https://yourtenant.sharepoint.com/sites/Site1",
"https://yourtenant.sharepoint.com/sites/Site2")

foreach ($site in $sites) {
Connect-PnPOnline -Url $site -Interactive
Set-PnPWeb -HeaderLayout Compact
}

Applies a Compact Header across all sites.


Step 4: Set the Footer Configuration

To enable and configure a SharePoint footer:

Set-PnPWeb -FooterEnabled $true -FooterLayout Simple

Enables a simple footer for the site.

For multiple sites:

$sites = @("https://yourtenant.sharepoint.com/sites/Site1",
"https://yourtenant.sharepoint.com/sites/Site2")

foreach ($site in $sites) {
Connect-PnPOnline -Url $site -Interactive
Set-PnPWeb -FooterEnabled $true -FooterLayout Extended
}

Enables and applies an Extended Footer across all sites.


Step 5: Automating the Branding Process

You can automate branding updates weekly or monthly using a scheduled PowerShell script:

$logPath = "C:\Logs\BrandingLog_$(Get-Date -Format 'yyyyMMdd').txt"

function Apply-Branding {
param ($siteUrl)

Connect-PnPOnline -Url $siteUrl -Interactive
Set-PnPWebTheme -Theme "Company Theme"
Set-PnPWeb -SiteLogoUrl "https://yourtenant.sharepoint.com/sites/branding/logo.png"
Set-PnPWeb -HeaderLayout Compact
Set-PnPWeb -FooterEnabled $true -FooterLayout Extended
"[$(Get-Date)] Applied branding to $siteUrl" | Out-File -Append -FilePath $logPath
}

$sites = @("https://yourtenant.sharepoint.com/sites/Site1",
"https://yourtenant.sharepoint.com/sites/Site2")

foreach ($site in $sites) {
Apply-Branding -siteUrl $site
}

Logs branding updates for monitoring.


Step 6: Verify Branding Application

To check the applied theme on a site:

Get-PnPWebTheme

To confirm branding settings:

Get-PnPWeb | Select Title, SiteLogoUrl, HeaderLayout, FooterEnabled

Displays current branding settings.


Troubleshooting Issues

1️⃣ Branding Not Applied?

Ensure PnP.PowerShell is updated

Update-Module PnP.PowerShell

Verify that the theme exists using

Get-PnPTenantTheme

2️⃣ Logo Not Updating?

Ensure the logo URL is accessible
Try re-uploading the logo

3️⃣ PowerShell Script Failing?

Run PowerShell as Administrator
Check for correct site URLs

Posted Under PNP PowerShellAutomation Branding Footer Header IT administration Logo Microsoft 365 PNP PowerShell SharePoint SharePoint Governance SharePoint online Themes

Post navigation

IoT and AI-Powered Digital Assistants
Enum in Java

Leave a Reply Cancel reply

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

Recent Posts

  • Agentic AI: The Dawn of Autonomous Intelligence Revolutionizing 2025
  • Recursive Queries in T-SQL
  • Generating Test Data with CROSS JOIN
  • Working with Hierarchical Data
  • Using TRY_CAST vs CAST

Recent Comments

  1. Michael Francis on Search , Filter and Lookup in power apps
  2. A WordPress Commenter on Hello world!

Archives

  • June 2025
  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • March 2024
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • June 2023
  • May 2023
  • April 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • January 2022

Categories

  • Active Directory
  • AI
  • AngularJS
  • Blockchain
  • Button
  • Buttons
  • Choice Column
  • Cloud
  • Cloud Computing
  • Data Science
  • Distribution List
  • DotNet
  • Dynamics365
  • Excel Desktop
  • Extended Reality (XR) – AR, VR, MR
  • Gallery
  • Icons
  • IoT
  • Java
  • Java Script
  • jQuery
  • Microsoft Teams
  • ML
  • MS Excel
  • MS Office 365
  • MS Word
  • Office 365
  • Outlook
  • PDF File
  • PNP PowerShell
  • Power BI
  • Power Pages
  • Power Platform
  • Power Virtual Agent
  • PowerApps
  • PowerAutomate
  • PowerPoint Desktop
  • PVA
  • Python
  • Quantum Computing
  • Radio button
  • ReactJS
  • Security Groups
  • SharePoint Document library
  • SharePoint online
  • SharePoint onpremise
  • SQL
  • SQL Server
  • Template
  • Uncategorized
  • Variable
  • Visio
  • Visual Studio code
  • Windows
© Rishan Solutions 2025 | Designed by PixaHive.com.
  • Rishan Solutions