Summary
The SharePoint 2010 workflow will retire. Microsoft announced it, see the following link.
SharePoint 2010 workflow retirement
For my customer, even after multiple messages to the Admins and Owners there was not an immediate action taken by the owners. To alert ‘SharePoint 2010 workflow retirement’ to all the identified sites my customer wants to add a banner similar to the following.
Solution
Prerequisite
- You should have the PnP PowerShell installed.
- You should have the SPFx development environment to create the .sppkg SPFx package.
- You should have configure and consented for PnP PowerShell on your tenant. Please follow this article.
Step # 1 : Create and install the SPFX application customizer for the modern site or page
Please click here to go to the GitHub Repo for the SPFx Application Customizer Extension.
Step # 2 : Add the JavaScript Link for the classic page or site
The JSLink file will allow to get the messages on the classic site or page.
Create a folder c:\SP2010RetirementBanner copy the above JSLink file.
Step # 3 : Using the PnP PowerShell script add the banner for the list of sites in CSV file.
Copy the Process-AddRemoveBanner.ps1 in c:\SP2010RetirementBanner.
Create site2process.csv file in c:\SP2010RetirementBanner folder with the header as Url. Add your tenant’s site URL per line.
From c:\ SP2010RetirementBanner, run the following PowerShell command using
# make sure the PS1 and js files are in the same directory i.e. c:\SP2010RetirementBanner
.\Process-AddRemoveBanner -ActionType "Add"
Step # 4 : If SP2010 workflow are removed, using the PnP PowerShell script Remove the banner for the list of sites in CSV file.
Run the following PowerShell command using
# make sure the PS1 and js files are in the same directory i.e. c:\SP2010RetirementBanner
.\Process-AddRemoveBanner -ActionType "Remove"
Conclusion
This approach is only an awareness to the end users to think about the issue of the SP2010 workflow will retire soon so they can migrate to modern workflow using Power Automate.