PowerShell quickie: Setting IIS App Pool IdleTimeout

I just did this and was frankly awash in a sea of misinformation, so here’s how it’s done.

What are the gotchas here?

Well one, just calling Set-ItemProperty does nothing but apply your change to an in-memory copy of the object. Not the object itself. Forget that solution

Second, you need to pass in a timespan object, not merely a straight number, or you’ll get unexpected results when it tries to set the timeout in ticks

Third: Do not forget the Set-Item call, or you’re utterly lost.

And that’s about it.

[update: I forgot to say, include:

Import-Module WebAdministration

At the start. I don't have to, because my servers ipmo that module in their PowerShell profiles. But you'll need to.]


One reply

  1. arthur says:

    thank you- you’re right about there being a ton of misinformation online about this…. :)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">