PowerShell IIS – PowerShell Script to Stop IIS AppPool Recycling

iispowershell

By default a new app pool will want to recycle itself on a regular time interval every 1740 minutes.

I want to clear this setting so the IIS never recycles it.

Best Answer

This will clear the time interval setting on the app pool

Import-Module WebAdministration
$pool = "IIS:\AppPools\mywebapp"
Set-ItemProperty $pool -Name Recycling.periodicRestart.time -Value 0.00:00:00