Simple SharePoint Warm Up Script (by Kirk Hofer)

This handy litlle powershell script has been grabbed from Kirk Hofer’s blog @ http://blogs.inetium.com/blogs/khofer/



Finally, my first post is finally in a working state…here we go:


For those of you who have to schedule those IISRESETs on your servers to clean memory and then do not want the time it takes the end user to hit the site and warm up the ASPX pages, here is a PowerShell script that is much to the liking.  I have seen others done in VBScript, but this is way cooler:

############################################################################
#Assumptions:
#-Running on machine with WSS/MOSS
#-C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN in path
############################################################################

$output=stsadm -o enumzoneurls
$x=$output
$x.ZoneUrls.Collection|
foreach-object -process {$y=stsadm -o enumsites -url $_.Default;$sites=$y;$sites.Sites.Site}|
foreach-object -process {write-host $_.Url; $html=[System.Net.WebRequest]::Create($_.Url);}


That is it, nothing else too crazy about this one.  It loops through all the web applications and then site collections and hits them all.  If you like PowerShell, and you know you do now…this is the icing…enjoy!


I know what a bitch it is to copy/paste code from some blogs and I know it is the same here [:$].


That’s why you can find the script in a text file attached to this post

One thought on “Simple SharePoint Warm Up Script (by Kirk Hofer)

Leave a Reply

Your email address will not be published. Required fields are marked *