I want to disable the idle timeout (Set it to Zero) of an application pool and I want to perform this at setup time, is it possible to perform this action from C# or PowerShell?
@R0MANARMY's answer (currently the most popular) didn't work for me. It runs fine, but the subsequent check shows that the idle timeout is unchanged.
Based on this blog post, that answer modifies an in-memory copy of the object. I modified the sample code in R0MANARMY's answer as:
Get-ChildItem IIS:\AppPools\$name | ForEach { $_.processModel.IdleTimeout = [TimeSpan]::FromMinutes(0); $_ | Set-Item; }