Sitemap for SharePoint 2010 using Powershell


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.

Sample Sitemap:

Powershell script for generating Sitemap:

Schedule sitemap (Optional):

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.

Step 1: Open Task Scheduler and create a Basic Task.

Step 2: Provide a Name and Description for the Task to be created

Step 3: Choose the time for the script to be executed everyday

Step 4: Choose the Start a program option

step 5: Type in Powershell.exe and input the script below at the Add arguments entry box:

-ExecutionPolicy Bypass <Script Location>  -Site  <Site URL>  -FilePath <Save Path\FileName.xml>
Example:  -ExecutionPolicy Bypass C:\Sitemap.ps1 -Site http://sharepoint-journey.com/ -FilePath C:\Users\Administrator\Documents\Sitemap.xml

step 6: Check the details of the Task to be created and the click Finish.

Conclusion:

In this article we have generated Sitemap for SharePoint 2010 using Powershell and scheduled using task scheduler.



› Sitemap for SharePoint 2010 using Powershell

About Author

Devendra Velegandla is a four-time recipient of Microsoft's Most Valuable Professional (MVP) award (2014-2017) for 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.


If you found this post helpful, please share with your friends!!


Join 5,500 subscribers and receive instant access to

Devendra's Library of Resources for SharePoint Developers