Set the ApplicationPool scheduled recycling

Set the ApplicationPool scheduled recycling

# Clean all scheduled recycles 
Clear-WebConfiguration /system.applicationHost/applicationPools/applicationPoolDefaults/recycling/periodicRestart/schedule

# Add periodic recycle (06h30)
Add-WebConfiguration /system.applicationHost/applicationPools/applicationPoolDefaults/recycling/periodicRestart/schedule -Value (New-TimeSpan -h 6 -m 30)

# Check if the recycle was added
Get-WebConfiguration /system.applicationHost/applicationPools/applicationPoolDefaults/recycling/periodicRestart/schedule/add | Select Value

Leave a Reply

Scroll to Top