It’s an age old problem, our SharePoint app pools recycle every night, or they get cranky. But because they recycle every night the first person to hit SharePoint each morning has to wait for the app pools to warm back up, which makes them cranky. All that crankiness makes me cranky. Over the years a variety of startup scripts have been written to address this, and they all work to varying degrees.
SharePoint 2013 requires PowerShell v3, and it comes with a bunch of new cmdlets. One of them jumped out at me, Invoke-WebRequest. This cmdlet can be used to download files from web sites, like WGET or CURL. The beauty of Invoke-WebRequest is that it’s built in to every SharePoint 2013 server. While it was built to download files, it can also be used to make general web requests, like to SharePoint sites. You know, to warm up their app pools. 
Since it’s PowerShell, it scripts like a dream. The following script will request the default page of the root site collection of each web application in your farm:
Get-SPWebApplication | ForEach-Object { Invoke-WebRequest $_.url -UseDefaultCredentials -UseBasicParsing }
The –UseDefaultCredentials parameter tells Invoke-WebRequest to log in to the web site as the person that PowerShell is running as. –UseBasicParsing tells Invoke-WebRequest to use basic parsing of the web page. We really don’t care about the web page, we just want to wake SharePoint up to send it to us.
If you have multiple WFEs you’ll need to run this on each server. Also, different SharePoint web templates have different assemblies in the background. If the root site collection of a web application is based a Publishing Template any Team sites in that web app will still need to be warmed up. If you wanted to warm up one of each type you could send Invoke-WebRequest a list of site collection URLs instead of web applications, like above.
Once you get it all figured out, you can schedule your PowerShell script to run every morning before the work day starts. Scheduling PowerShell is a little tricky. You can use this blog post to create the scheduled task to warm up your app pools for you.
You’ll probably need to modify this for your environment, but hopefully it will get you started.
tk
ShortURL: http://www.toddklindt.com/PoshWarmUp