Just a quicky: Start all stopped application pools in IIS that have the autostart property set to true. Easily with appcmd, and here’s is how.

AppCmd supports the piping of commands. You can use the /xml parameter to generate XML formatted output, and pipe it through to the /in parameter. It reads and operates on the XML input.

This makes it ideal to pipe multiple Appcmd commands into a single command, for example to start all application pools that are in a stopped state but having the Autostart property.

appcmd list apppools /state:stopped /autostart:true /xml | appcmd start apppool /in

In PowerShell, use the Start-WebAppPool with Get-ChildItem to start all application pools:

# if required: Import-Module WebAdministration
Get-ChildItem IIS:\AppPools | Where-Object { $_.autoStart -eq "True" -and $_.state -eq "Stopped" } | Start-WebAppPool

Did this post help you solve a problem? Want to say thanks?

Then why not buy me a coffee? A small donation of just $5 (or more 😉 ) helps out a lot in the development, research and hosting of this blog.

If I’ve helped you out and you want to thank me, why not buy me a coffee?

Thank you for your support.