Project Description
After different reviews of this functionality on the web, I decided to create my own script to wake up SharePoint sites. This script can be enhanced with all your suggestions.
By default, when you restart your server or for example IIS, all the pages have to be recompiled. This time can be disturbing for an end-user. This script solves this issue.

Handbook

Description
This executable has one configuration file and generates logs either in the Windows console or in a specific folder.

Installation
Download the zip file in the Releases section, then you can deploy it by simply unzipping the package where you want in your SharePoint farm. This tool can be deployed on one back-end server to wake-up all your front-end servers (see future enhancements).

Commands
ENT_MOSS_WAKEUP.exe [-help] [-path [Path to configuration file]) [-log [console] / [Path to log directory]]

Example:
  • ENT_MOSS_WAKEUP.exe -help: To display this help
  • ENT_MOSS_WAKEUP.exe: The tool won't generate logs and the configuration file will be sites.conf in the same folder
  • ENT_MOSS_WAKEUP.exe -path c:\sites.conf: The tool won't generate logs and the configuration file will be sites.conf in the c:\ drive
  • ENT_MOSS_WAKEUP.exe -log console: The tool will generate console logs and the configuration file will be sites.conf in the same folder
  • ENT_MOSS_WAKEUP.exe -log c:\: The tool will generate file logs in the c:\ drive and the configuration file will be sites.conf in the same folder
  • ENT_MOSS_WAKEUP.exe -path c:\sites.conf -log c:\: The tool will generate file logs in the c:\ drive and the configuration file will be sites.conf in the c:\ drive

Configuration file
If you don't specify a configuration folder with the parameter -path, the configuration file must in the same folder as the Executable with the name sites.conf

The configuration file muts have the following format:
  • One line per site collection
    • Format: depth|sitecollection url
      • If depth equals 1 we browse the top site, if depth equals 2, we browse the top site and the sub sites just below, etc...
      • If depth equals F, we will do a full refresh of all the pages inside the site collection
  • Example:
    • 3|http://site.com
    • F|http://site.com/search

Log files

The tool generates some logs in order to track the pages refreshed and also the time taken to refresh them. There are three mechanisms:
  • No output logs
  • Output logs in a file
  • Output logs in the Windows console

Parameters:
  • ENT_MOSS_WAKEUP.exe -log console: Output logs in the Windows console
  • ENT_MOSS_WAKEUP.exe -log pathtolog: Output logs in a file
  • ENT_MOSS_WAKEUP.exe: No output logs in a file

Example:
  • ENT_MOSS_WAKEUP.exe -log console
  • ENT_MOSS_WAKEUP.exe -log c:\
  • ENT_MOSS_WAKEUP.exe

Format of the file generated:
The logs are generated inside a specific directory with the following format:
ENT_MOSS_WAKEUP_YYYY_MM_DD_HH_MM_SS.txt

Format of the log file:
For each URL called, we know exactly the time spent to refresh it. If you run a second time the script, it should be less.
At the end of the file, you will also see the number of pages refreshed and total time spent to do the refresh.

Example of an output file:
New site added: Url http://server, Depth 3
New site added: Url http://server/sites/subsite, Depth Full
Site Url: http://server | 2545.2124
Publishing Url: http://server/Pages/default.aspx | 499.6736
Publishing Url: http://server/Pages/advanced.aspx | 515.2884
Publishing Url: http://server/Pages/people.aspx | 484.0588
Publishing Url: http://server/Pages/results.aspx | 484.0588
Publishing Url: http://server/Pages/peopleresults.aspx | 593.3624

Wake-up end. Total Pages: 515
Wake-up end. Total Time: 830644.9008

Future enhancements

  • Be able to refresh all the web-front end servers in a farm without specifying directly all the servers.

Available links

When I started this project, I checked first this web site and it helps me to understand a way to implement it.
http://code.msdn.microsoft.com/spwakeup

Last edited Mar 23, 2008 at 8:40 PM by mlainne, version 22