Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to recycle all app pools on an IIS6 server at once without using iisreset or manually recycling each one?

share|improve this question

If you have the names of all the application pools, you could use iisapp.vbs (in systemroot\system32) in a script to restart them all.

iisapp /a NameOfAppPool /r
share|improve this answer
up vote 1 down vote accepted

I ended up using the following VBScript for IIS6:

Set oWMI = GetObject _
Set aAppPools = oWMI.ExecQuery("Select * from IIsApplicationPool")

For Each oItem in aAppPools
    WScript.Echo("Recycling " & oItem.Name & "...")

WScript.Echo("Recycled " & aAppPools.Count & " Application Pools.")

It has the advantage of not needing to know the names of the application pools beforehand, but you do have to have WMI enabled.

And the version for IIS7:

Set oWebAdmin = GetObject _
Set aAppPools = oWebAdmin.InstancesOf("ApplicationPool")

For Each oAppPool in aAppPools
    WScript.Echo("Recycling " & oAppPool.Name & "...")

WScript.Echo("Recycled " & aAppPools.Count & " Application Pools.")


share|improve this answer

If you need to recycle them all, you might as well IISReset.

Alternatively (if this is, for example, an FTP preservation exercise), you could try restarting just the WWW Publishing service.

share|improve this answer
Pool recycle is faster, and has no downtime, while IIS Reset has. – Gerardo Grignoli Nov 5 '14 at 19:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.