Christopher Cass
Christopher Cass

Reputation: 969

Get Specific Recycling Time For IIS With PowerShell

I'm trying to find the specific time that my app pool is set to recycle on my server using PowerShell. I know it's set to recycle at 1 AM daily on the test server that I'm looking at. I'm running:

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

and the value that's showing is 00:00:00

For testing purposes, I attempted to run:

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

I checked to see how this changed. The "Specific Time(s)" field still reads 1:00 AM, but now the "Regular Time Intervals (in minutes)" is set to 4320 minutes. So apparently I'm looking at the wrong value... Any idea how I can see the value in the "Specific Time" field?

Upvotes: 3

Views: 7226

Answers (1)

Ben Richards
Ben Richards

Reputation: 3575

Here you go:

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

Get it with:

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

Upvotes: 6

Related Questions