Warm up script for Sharepoint sites


If you are preparing for a Demo or labs and just restarted your VM or performed a deployment and would like to make sure that your sites loads quickly for end users you must have the below script.  this script will allow you to warm up your site and will result in happy customers and may result in less “Man SharePoint is slow” thing.

cls 
 
function Get-WebPage([string]$url,[System.Net.NetworkCredential]$cred=$null) 
{ 
$wc = new-object net.webclient 
if($cred -eq $null) 
{ 
$cred = [System.Net.CredentialCache]::DefaultCredentials; 
} 
$wc.credentials = $cred; 
return $wc.DownloadString($url); 
} # end Function 
 
 
#This passes in the default credentials needed. You can run this task as a user that has a Policy  
# above all the Web Applications by manually adding the correct permissions 
$cred = [System.Net.CredentialCache]::DefaultCredentials; 
# or 
#$cred = new-object System.Net.NetworkCredential("username","password","machinename") 
 
#Change these URL's to suit your environment. Simply add more lines if you need more. 
$html = Get-WebPage -url "http://intranet.contoso.com/" -cred $cred 
$html = Get-WebPage -url "http://intranet.contoso/" -cred $cred
#Repeat for every site collection  

Note: Best thins would be to put this script in Task Schedular and enable it to run it daily at 7 AM.  Mostly App pool recyles happens early morning so your sites will be fresh when first user hits it.

Capture Fiddler Trace from Client Machine


There might be a situation during troubleshooting that you want to get the fiddler trace from end user computer or browser. The steps below will help you get it.

Download Fiddler cap from http://www.telerik.com/fiddler/fiddlercap

  1. Start Filler Cap and click Start Capture

  1. Browse will open the Site

  1. Add-Screenshots if needed

  1. Click Stop Capture

  1. Save Capture

  1. Send the .saz file by Email.

 

Open Fiddler capture

  1. Start Fiddler on Developer Machine