Get Specific IIS Recycle Times

This topic contains 3 replies, has 2 voices, and was last updated by  Chris Cass 6 months ago.

  • Author
    Posts
  • #71248

    Chris Cass
    Participant

    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?

  • #71432

    Don Jones
    Keymaster

    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.

  • #71434

    Don Jones
    Keymaster

    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.

    • #71444

      Chris Cass
      Participant

      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
      

You must be logged in to reply to this topic.