Forum Discussion
Nov 04, 2011
You could absolutely do that with iControl. The process would be something like this
1. Modify pool member to disable any new connections with the set_session_enabled_state() method passing in STATE_DISABLED for the associated pool member(s).
2. Use the PoolMember's get_statistics() methods to query the CURRENT_CONNECTIONS statistic until that value drops down to zero.
3. Issue the remote call to your windows box to reset IIS.
4. Re-enable new sessions by passing STATE_ENABLED to the set_session_enabled_state() method.
I've wrote a tech tip titled "Graceful Server Shutdown" that you could use as a basis to start with (it's with our PowerShell library which should integrate well with IIS controls).
http://devcentral.f5.com/Tutorials/TechTips/tabid/63/articleType/ArticleView/articleId/254/iControl-Apps--04--Graceful-Server-Shutdown.aspx
You'll just have to add the IIS hooks in there.
Hope this helps...