Set Footer in SharePoint Online Communication Site using PowerShell
Requirement: Set Footer in SharePoint Online Communication Site using PnP PowerShell
How to Provision Footer links in SharePoint Online using PnP Provisioning Template?
Go to PnP Provisioning Schema repository in GitHub and build your provisioning template. https://github.com/SharePoint/PnP-Provisioning-Schema, Here is mine:
Provisioning Template XML for Footer Links:
PowerShell to Apply Provisioning Template
Once the template is ready, apply the template to the site using below PnP PowerShell script.
Here is the Script in action
How to Provision Footer links in SharePoint Online using PnP Provisioning Template?
Go to PnP Provisioning Schema repository in 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="http://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="http://www.crescent.com/contact-us" /> <pnp:FooterLink DisplayName="Site Map" Url="http://www.crescent.com/sitemap" /> <pnp:FooterLink DisplayName="Privacy Policy" Url="http://www.crescent.com/privacy-policy" /> </pnp:FooterLinks> </pnp:Footer> </pnp:ProvisioningTemplate> </pnp:Templates> </pnp:Provisioning>Make necessary changes and save this as a XML file. E.g. PnpFooter.xml
PowerShell to Apply Provisioning Template
Once the template is ready, apply the template to the site using 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 -UseWebLogin #Apply provisioning Template Apply-PnPProvisioningTemplate -path $TemplateXML
Here is the Script in action
No comments:
Please Login and comment to get your questions answered!