Skip to main content

Posts

Showing posts with the label #TechTips

Automate SharePoint Site Creation with PowerShell and PnP

Creating new SharePoint sites while maintaining a consistent look and feel can be challenging. Fortunately, with PowerShell and the PnP (Patterns and Practices) framework, we can automate the process of backing up a site template and applying it to a new site. This blog post will guide you through the necessary steps. Prerequisites Before you begin, ensure you have the following: SharePoint Online Management Shell PnP PowerShell module installed Appropriate permissions to access the SharePoint site and admin center Step-by-Step Guide 1. Backup the Site Template First, you need to connect to the source site and back up its template. # Source Site URL input $SourceSiteURL = Read-Host "Enter Source Site URL" # Path to XML file $SchmaXMLPath = " " # Connect to PnP Online to take template backup Connect-PnPOnline -Url $SourceSiteURL -Interactive # Get Site Schema and save to file Get-P

Identifying Stream Web Parts in SharePoint Pages

Microsoft recently announced that they are discontinuing the classic Stream and introducing a new version. This change necessitates the identification of Stream web parts across SharePoint pages within your organization. To help with this transition, you can use a PowerShell script to scan your SharePoint sites for any Stream web parts that may be in use. Below is a detailed explanation of how to achieve this using PowerShell and the PnP PowerShell module. Script Overview The script provided here connects to your SharePoint Online sites, iterates through all site pages, and checks for the presence of Stream web parts. It compiles a list of these pages and exports the information to a CSV file. Key Components of the Script 1. Parameters and Global Collection Initialization $PagesDataCollGlobal = @() 2. Function Definition: CheckWebParts This function connects to a given site, retrieves all site pages, and checks each page for Stream web

Copying Footers Between SharePoint Sites Using PnP PowerShell

Recently, I have been extensively working with SharePoint and the Patterns and Practices (PnP) PowerShell module. PnP has significantly simplified various tasks by providing easy-to-use command sets and thorough documentation. One particular task that PnP has made straightforward is copying a footer from one SharePoint site to another. This process can be achieved with just a few commands. Why Use PnP PowerShell? PnP PowerShell is a set of cmdlets designed to work with SharePoint Online and SharePoint on-premises. It simplifies the management and automation of common tasks and provides commands for nearly every aspect of SharePoint administration. The PnP module is especially useful for tasks that would otherwise require complex scripting or manual intervention. Copying a Footer with PnP PowerShell To copy a footer from one SharePoint site to another, follow these steps. This process involves exporting the footer template from the source site in XML format and