Posts

Showing posts with the label classic

Adding Script Editor web part to SharePoint classic page using PowerShell

Image
 Hi friends, When we are migrating the SharePoint on-prem to SharePoint online, we need to tell the users about the site is migrated and there are multiple ways of doing it. One of them is to add the redirection script on the page so that the user will get redirected by itself to the newly migrated site. In this blog, I will be showing how to add the script editor web part using the PowerShell and add the script as well. Problem Statement I have a SharePoint list where all the old sites and new sites are mapped. Need to read all the items and add the script editor web part along with the script for the redirection of the page to the new site URL. Script added - It highlights the page and redirects the user to the new site after 10 seconds. Note: If there is a need to change in the script, do change in the  $WebPartXml  variable. Hope this script will save a lot of time and will help you. Happy Coding..!!

PowerShell Script to update Page Layout in SharePoint online using PnP

Image
Hi Friends, I have came across a very common requirement where I need to update the page layout of the SharePoint online page (classic page), but I think same can be used to update the page layout to the modern SharePoint site. For this I have written a PowerShell script which will update the pages from a specif page layout to the desired page layout. In this script I have also taken care if you are updating the page layout of the subsite, than also this script will handle the scenario. There are 2 parameters which you need to update Old page layout title New page layout title The updation due to this script will not change the modified by as well as modified date, so the original data is not lost. Please provide your comment if you feel that something can be enhanced in the script or if there is any issue