For a client I wanted to implement automatic recycling of an Application Pool on Windows Server 2008, to be called from an event handler in nagios. I scorched the net for possible solutions, and found many suggestions, including iisreset.exe, iisapp.vbs and various wmi-based scripting techniques, none of which worked out.
After a while, nearly giving up, I stumbled upon
this page which showed the correct technique:
c:\windows\system32\inetsrv\appcmd.exe recycle apppool "website.com"