Microsoft All-In-One Script Framework - IT Pros' Time Saver

[Script of Mar. 18] PowerShell Scripts to Warm-Up Applications in Microsoft SharePoint Server 2010

[Script of Mar. 18] PowerShell Scripts to Warm-Up Applications in Microsoft SharePoint Server 2010

Rate This
  • Comments 1

Script Download: WarmupSiteApplication.zip
http://gallery.technet.microsoft.com/scriptcenter/PowerShell-to-Warm-Up-0988dd61

This script could be used to warm-up site application.

Application warm-up is requested to improve customer experience for the sites taking long time on initialization after application pool recycling.

image image
image

You can find more All-In-One Script Framework script samples at http://aka.ms/onescriptingallery

Leave a Comment
  • Please add 5 and 8 and type the answer here:
  • Post
  • Here is the script that I use.  The benefit is that is uses the SharePoint snapin to determine what sites are available in the farm and hits each one to warm it up.  New sites will automatically be warmed up.  I schedule it on one of the web front end servers in the farm.

    Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction:SilentlyContinue

    function Get-WebPage

    {

    param(

    [string]$url

    )

    Write-Host "Getting $url"

    $wc = New-Object Net.Webclient

    $wc.Credentials = [System.Net.CredentialCache]::DefaultCredentials

    return $wc.DownloadString($url);

    }

    Get-SPWebApplication -IncludeCentralAdministration | %{ Get-SPSite $_.Url } | Get-SPWeb | %{

       $null = Get-WebPage -url $_.Url

    $_.Lists | ?{ -not $_.Hidden } | %{

           Get-WebPage "$($_.ParentWeb.Site.Url)$($_.DefaultViewUrl)" | Out-Null

    }

    }

Page 1 of 1 (1 items)