Powershell Script – Recycle All Application Pools

Powershell Script – Recycle All Application Pools
4 votes, 4.75 avg. rating (94% score)

Introduction

The following script will restart all application pools of IIS. It’s well known fact that IISReset should only be used when necessary but not to restart app pools.

Create claims based web application


NOTE: We are assuming application pool already exists

Write-Host "App Pool Recycling Started...." -ForegroundColor Magenta 
& $env:windir\system32\inetsrv\appcmd list apppools /state:Started /xml | & $env:windir\system32\inetsrv\appcmd recycle apppools /in
Write-Host "App Pool Recycling Completed" -ForegroundColor Magenta 

Save the above script in powershell script file and execute.

image

Conclusion

Hope this simple and powerful script will help you to quickly recycle all app pools. Most of the times app pool recycle will be fit rather than IIS reset.

March 17, 2015 В· Adi В· No Comments
Tags: , ,  В· Posted in: Powershell, Sharepoint 2010, SharePoint 2013

Leave a Reply

What is 15 + 6 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)