Search code examples
iis-6restart

restart specific website in IIS6 via command line


Does anyone know if I can restart a specific website within IIS 6 using the command line.

I don't want to use a blanket IISReset /restart command if I can avoid it.

I have a site that has an issue and is maxing out the server, I need to find a fix for it but in the meantime I also want to sleep so I'd like to just restart it every 10 minutes overnight to nurse it through.


Solution

  • Sounds like you actually want to recycle an Application pool rather than stop/start a website.

    To do this you can use the IISAPP.vbs utility:

    cscript c:\windows\system32\iisapp.vbs /a "My AppPool" /r

    You can run the utility with a /? flag for full usage details and some sample commandlines.

    If you really want to start/stop a website you can use the ADSUTIL.vbs utility:

    cscript c:\inetpub\adminscripts\adsutil.vbs STOP_SERVER W3SVC/1

    cscript c:\inetpub\adminscripts\adsutil.vbs START_SERVER W3SVC/1

    For more information on ADSUTIL.vbs please see this page :

    Using the Adsutil.vbs Administration Script (IIS 6.0)