Sharepoint Warmup Script
By Anatoly Mironov
It is useful to warm up a site after app pool recycling or after a site creation in development environments. I found a very simple script which I made even simpler:
$url = "http://takana"
$wc = new-object net.webclient
$wc.credentials = \[System.Net.CredentialCache\]::DefaultCredentials
$wc.DownloadString($url) | out-null
$wc.Dispose()
For more sophisticated warmups Wahid Salemi provided an interisting script to warm up your Sharepoint. By the way. Let us save it as a powershell function. Take a look at sharepointryan’s functions. Let’s create a proper function of that:
function WarmUp-Site {
<#
.Synopsis
Use this PowerShell script warm up a site.
.Description
This PowerShell script uses net.webclient class to download the page and trigger warmup.
.Example
WarmUp-Site -url http://intranet
This example warms up http://intranet site.
.Notes
Name: WarmUp-Site
Author: Anatoly Mironov
Last Edit: 2012-01-25
Keywords: Warmup, Site
.Link
https://sharepointkunskap.wordpress.com
.Inputs
None
.Outputs
None
#Requires -Version 2.0
#>
\[CmdletBinding()\]
Param(
\[string\]$url=(Read-Host "Please provide a site url (Examples: http://intranet)")
)
$wc = new-object net.webclient
$wc.credentials = \[System.Net.CredentialCache\]::DefaultCredentials
$wc.DownloadString($url) | out-null
$wc.Dispose()
}
Comments from Wordpress.com
SP Warm-up « RaSor's Tech Blog - Jun 3, 2012
[…] A simple script: https://sharepointkunskap.wordpress.com/2011/09/29/sharepoint-warmup-script/ […]