Posted on July 4th, 2014
We were working on how to generate sitemap for SharePoint 2010 using Powershell for public facing site and come across this article to generate sitemap.xml. Our requirement is to add few more additional columns like last modified date, change frequency and priority. Please see the below sample site map file that we need to generate.
This step is optional. To have an updated the sitemap based on regular intervals of time, the script has to be executed again to scan whether there are new page entries that are needed to be taken into consideration. To do that we can use task scheduler.
Please follow the below steps to schedule the Powershell scrip for sitemap.
-ExecutionPolicy Bypass <Script Location> -Site <Site URL> -FilePath <Save Path\FileName.xml>
Example: -ExecutionPolicy Bypass C:\Sitemap.ps1 -Site https://www.sharepoint-journey.com/ -FilePath C:\Users\Administrator\Documents\Sitemap.xml
In this article we have generated Sitemap for SharePoint 2010 using Powershell and scheduled using task scheduler.
Devendra Velegandla is a five-time recipient of Microsoft's Most Valuable Professional (MVP) award (2014-2019) for Office Apps and Services, Office Servers and Services MVP and SharePoint Server. He received the MCC award for his contributions in Microsoft MSDN/TechNet forums. He loves sharing articles, videos, and tutorial on SharePoint and Office 365.