SharePoint Online: Change Header Layout, Site Logo, Background using PowerShell

Requirement: Change Header layout, Site Logo and Background settings in SharePoint Online.

How to Set Header layout, Site Logo and Background in SharePoint Online?
To change the header settings in SharePoint Online,
  • Click on "Settings" gear icon >> Click on "Change the look" from site settings menu.
    sharepoint online header logo
  • Click on "Header"
    sharepoint online compact header layout
  • Set the header layout, site logo and header background.
    header background color
  • Click on "Save" to commit your changes.

PowerShell to Set Header layout, Site Logo and Background:
Lets change the SharePoint Online header layout, header background color and header logo using PowerShell.
#Set Variables
$SiteURL = "https://crescent.sharepoint.com/sites/credit"
$LogoURL= "https://crescent.sharepoint.com/sites/credit/SiteAssets/logo.jpg"
  
#Connect to PNP Online
Connect-PnPOnline -Url $SiteURL -UseWebLogin
 
#Get the Web
$Web = Get-PnPWeb

#Set Header Options
$Web.HeaderLayout = "Standard"   # Standard, Compact
$Web.HeaderEmphasis = "None"  # None, Neutral, Soft, Strong
$Web.SiteLogoUrl = $LogoURL
$Web.Update()
Invoke-PnPQuery

Please note, on group connected modern sites, SharePoint gets the logo from the group! So we got to set the logo of the Office 365 group.
SharePoint Online: Change Header Layout, Site Logo, Background using PowerShell SharePoint Online: Change Header Layout, Site Logo, Background using PowerShell Reviewed by Salaudeen Rajack on August 05, 2019 Rating: 5

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.