Set Footer in SharePoint Online Communication Site using PowerShell

Requirement: Set Footer in SharePoint Online Communication Site using PnP PowerShell.

Go to the PnP Provisioning Schema repository on GitHub and build your provisioning template. https://github.com/SharePoint/PnP-Provisioning-Schema, Here is mine:

Provisioning Template XML for Footer Links:

<?xml version ="1.0"?>
<pnp:Provisioning xmlns:pnp="https://schemas.dev.office.com/PnP/2019/03/ProvisioningSchema">
 <pnp:Preferences/>
 <pnp:Templates ID="CONTAINER-TEMPLATE-c49f81cd-19d0-458d-a99d-1a616c252add">
  <pnp:ProvisioningTemplate ID="TEMPLATE-c49f81cd-19d0-458d-a99d-1a616c252add" Version ="1">
  <pnp:Footer Enabled="true" Name="" Logo="SiteAssets/logo.png" RemoveExistingNodes="true">
    <pnp:FooterLinks>
      <pnp:FooterLink DisplayName="Contact Us" Url="https://www.crescent.com/contact-us" />
      <pnp:FooterLink DisplayName="Site Map" Url="https://www.crescent.com/sitemap" />
      <pnp:FooterLink DisplayName="Privacy Policy" Url="https://www.crescent.com/privacy-policy" />
     </pnp:FooterLinks>
  </pnp:Footer>
  </pnp:ProvisioningTemplate>
  </pnp:Templates>
</pnp:Provisioning>

Make necessary changes and save this as an XML file. E.g., PnpFooter.xml

PowerShell to Apply Provisioning Template

Once the template is ready, apply the template to the site using the below PnP PowerShell script.

#Config Variables
$SiteURL = "https://crescent.sharepoint.com/sites/hr"
$TemplateXML  ="C:\Users\salaudeen\Desktop\PnpFooter.xml"
 
#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL -Interactive

#Apply provisioning Template
Invoke-PnPSiteTemplate -path $TemplateXML

Here is the Script in action

provision footer in sharepoint online communication site using powershell

If the footer is not enabled already, You may have to enable it: How to Enable or Disable Footer in SharePoint Online Communication Sites?

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

2 thoughts on “Set Footer in SharePoint Online Communication Site using PowerShell

  • Hi Salaudeen Rajack,

    Good Evening. I have tried to update the footer links and followed the above steps. unfortunately, the footer theme is not applying.

    I have come across this article; “pnp: footer” is not listed.
    https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/pnp-provisioning-schema

    Would like to know if the pnp footer provisioning depreciated?

    Note: Steps I have followed as per your article. Please do let me know if I wanted to do any specific configuration.

    Thanks

    Reply

Leave a Reply

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