Many of you will know that when you IISRESET a MOSS sever the first logon on to the site can take some time. SharePoint configures IIS to recycle the application pools on a nightly basis between the hours of 1 –2am (This is easily changed if these times are not convenient.
From investigation further I found a great script created by Kirk Hoffer’s – All credit goes to Kirk for this one.
You will need to download and install PowerShell on all SharePoint Server if running Windows 2003 (installed as part of Windows 2008) from here.
There's a great intro on how to run PowerShell scripts here.
From the link above basically you need to run the command in PowerShell:
This needs to be entered only once to allow scripts to run otherwise you will receive errors when attempting to run the script.
Next step is to create a bat file to run the script after the application pool recycle nightly. Lets say 2.30.
Simply add the line:
powershell.exe c:\scripts\warmup.ps1 (assuming you placed the ps file in the scripts folder)
Create a scheduled task to run the newly created bat file and your done.
Please note that the script resets all SharePoint sites on the local server and may take time. Please test this script before adding to live environments.
Simply copy the code in the table below and name with the file extension ‘ps1’ e.g. warmup.ps1