Warm Up Script for SharePoint

You can use this warm up script after deployment in SharePoint it will bring back your site faster thna browser.

Write below line in text file and save as BAT file

####################################################################
powershell -command “& ‘D:\Satish\WarmUp\Satish\WarmUp.ps1′”
####################################################################

Write Below lines in text file and save as ps1 file

####################################################################
    $ver = $host | select version
    if ($ver.Version.Major -gt 1) {$host.Runspace.ThreadOptions = “ReuseThread”} 
    if ((Get-PSSnapin “Microsoft.SharePoint.PowerShell” -ErrorAction SilentlyContinue) -eq $null) {
        Add-PSSnapin “Microsoft.SharePoint.PowerShell”
    }
    
   function Get-WebPage([string]$url)
   {
       $wc = new-object net.webclient;
       $wc.credentials = [System.Net.CredentialCache]::DefaultCredentials;
      $pageContents = $wc.DownloadString($url);
      $wc.Dispose();
     return $pageContents;
   }
   

write-host “http://igtehydzbnv02:2210/sites/AppCentralSatish/“;
$html = Get-WebPage -url “http://igtehydzbnv02:2210/sites/AppCentralSatish/“;
write-host “Done”;
read-host;
#######################################################################

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