Warmup script for sharepoint

I have seen a number of these around.  Most are copies of a broken script.  This one works.

The first component is a boo script:

This requires the Boo.Lang.Dll and needs to be compiled with the boo compiler booc (booc warmup.boo)

==== warmup.boo ======
import System.Net

def warmup(url as string):
    request = WebRequest.Create(url)
    request.Credentials = CredentialCache.DefaultCredentials
    request.Method = “GET”
    response = request.GetResponse()

for url as string in argv:

The second component is a batch file:

==== Warmup.bat ====
@cscript iisapp.vbs /a MyAppPool /r
@Start /min warmup http://myurl:50002/page1.aspx http://myurl:50002/page2.aspx
@Start /min warmup http://myurl:50002/page3.aspx

These should save you hours of waiting around for SharePoint at the cost of a little bit of load.  Beware I am unable to test the first line of the script as I am not currently at a W2k3 box.  It recycles a given app pool.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s