Home > Uncategorized > SharePoint Warm Up PowerShell script

SharePoint Warm Up PowerShell script

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=[xml]$output
$x.ZoneUrls.Collection|
foreach-object -process {$y=stsadm -o enumsites -url $_.Default;$sites=[xml]$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!

from http://blogs.inetium.com/blogs/khofer/archive/2007/11/13/simple-sharepoint-warm-up-script.aspx

Categories: Uncategorized Tags:
  1. Pankaj Jain
    December 29th, 2009 at 13:09 | #1

    Warm-up script for sharepoint is fine only with web application and site collection. But throw error when site collection contain subsites.Please let me know how to make the neccessary changes so that it could also hit the sites in every site collection. I would really appriciate if you send the solution on my Email-Id.

  1. No trackbacks yet.