Warmup Script – SharePoint

Got tired of implementing huge warmup scripts, so decided to put together the simplest form. This will hit all site objects within the sharepoint farm.

the $ie.Visible = $true, should only be used in the development phase. It can be set to $false or completely omitted. With false or omitted, it will only spawn a process and not display the GUI of internet explorer.

add-pssnapin microsoft.sharepoint.powershell
$sites=get-spsite -Limit All
foreach ($site in $sites)
	{
	$ie = New-Object -ComObject "InternetExplorer.Application"
	$url = $site.url
	$ie.Navigate($url)
	$ie.Visible = $false
	#wait for page to load
	while ($ie.ReadyState -ne 4)
		{
		sleep -Milliseconds 100
		}
		$ie.Quit()
	}

Edit 27-July-2016: Changed from single site to all SP sites.

Advertisements

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 )

Google+ photo

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

Connecting to %s