Author Posts

May 22, 2017 at 8:51 pm

I'm trying to audit a number of web servers to find out when each one is scheduled for IIS recycling on a specific app pool. I know my test server is set to recycle at 1pm, so I ran

Get-ItemProperty -Path IIS:\AppPools\WebPage -Name recycling.periodicRestart.time

and found the value was set to 00:00:00:00

I found this script to edit recycling time, so I ran it to see what changed:


Set-ItemProperty -Path IIS:\AppPools\WebPage -Name recycling.periodicRestart.time -Value 3.00:00:00

I then checked the setting and noticed this updated the "regular time interval" to 4320 minutes (3 days). But I'm looking to find the "Specific Time" value, not the "regular time interval."

I then found this script that ended up changing the specific time:

Set-ItemProperty -Path IIS:\AppPools\WebPage -Name recycling.periodicRestart.schedule -value @{value = '03:00:00'}

So I attempted to run

Get-ItemProperty -Path IIS:\AppPools\WebPage -Name recycling.periodicRestart.schedule

but the results don't seem to show me anything that looks like the time. I see a childelement called "schedule," but don't see any way to see the value... Anybody have an idea for this?

May 24, 2017 at 3:11 pm

Schedule is a hash table, meaning it has sub-elements. Since you found a script that changes to a specific time, what happened when you ran that? I'd expect schedule to be empty if it's not set.

May 24, 2017 at 3:11 pm

Schedule is a hash table, meaning it has sub-elements. Since you found a script that changes to a specific time, what happened when you ran that? I'd expect schedule to be empty if it's not set.

May 24, 2017 at 3:47 pm

Thanks Don. I actually got it to work with:

import-module webadministration
$iisrecycling = Get-itemproperty -Path IIS:\AppPools\Website -Name recycling.periodicRestart.schedule.collection

$iisrecycling.value.hours