Rich Posted March 3, 2009 Posted March 3, 2009 Is there any way to restart an application pool in IIS using AutoIT? I've already made a script that will check to see if the site is up, and then email me if it fails. I'd like to add the function of restarting the app pool when it fails as well. Any help would be appreciated
PsaltyDS Posted March 3, 2009 Posted March 3, 2009 (edited) Is there any way to restart an application pool in IIS using AutoIT? I've already made a script that will check to see if the site is up, and then email me if it fails. I'd like to add the function of restarting the app pool when it fails as well. Any help would be appreciated IIS6: Global $oAppPool = ObjGet("IIS://localhost/W3SVC/AppPools/DefaultAppPool") $oAppPool.Stop() Sleep(15000) $oAppPool.Start() Edited March 3, 2009 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Rich Posted March 3, 2009 Author Posted March 3, 2009 Fantastic! One more thing... Do you know of a way to check the status of the app pool? I've been searching all over the forums and can't find any info on this at all. The script I have that checks the site will get data back ("Service Unavailable") if the app pool is dead, so it assumes the site is still up. Thanks again for the restart code, that helps a TON
PsaltyDS Posted March 3, 2009 Posted March 3, 2009 Fantastic! One more thing... Do you know of a way to check the status of the app pool? I've been searching all over the forums and can't find any info on this at all.The script I have that checks the site will get data back ("Service Unavailable") if the app pool is dead, so it assumes the site is still up. Thanks again for the restart code, that helps a TONJust Google up the equivalent VBScript to do it and convert to AutoIt. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Rich Posted March 3, 2009 Author Posted March 3, 2009 I'm still looking for a good way to check the application pool status. In the meantime, if the script could check for the word "Unavailable" in the body, that would be sufficient. I think _INetGetSource might be a good way to go about this, but not sure about the parameters needed.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now