Warming Up SharePoint Servers After Cold Restart
Everyone knows how painful it is to try reaching a MOSS page after an IIS reset or a server reboot; what happens is ASP.NET performing page and resource compilation and caching. You can help your users save frustration by simply touching every MOSS web application once after a cold restart. Of course you would prefer to automate such a task instead of firing up a browser every time your server restarts. Isn't it easier to click on an icon on your desktop and warm-up all those 20 SharePoint servers at once?
To create a warm up script we can use Microsoft's own XMLHTTP object from XML DOM suit and Windows Scripting. The simplest VB script to touch a web page would look like:
' Check if a site url specified
if wscript.Arguments.Count <> 1 Then
wscript.Echo "Please specify a url!"
wscript.Quit
end If
Dim xmlHttp
Set xmlHttp = CreateObject("Msxml2.ServerXMLHTTP.3.0")
If Err.Number <> 0 Then Set xmlHttp = CreateObject("Microsoft.XMLHTTP")
If Err.Number <> 0 Then wscript.Quit
wscript.Echo "Touching " & CStr(wscript.Arguments(0))
xmlHttp.Open "GET", CStr(wscript.Arguments(0)), False
xmlHttp.Send
And you can call this script from a batch file using wscript.exe or cscript.exe tools which run the script in the Windows script Host:
wscript c:\warmup.vbs "http://moss.com/site"
So just add such a command for all your moss sites to a batch file and run after each cold restart.