Hi, is it possible to manage IIS web applications with NAnt? For example stop or start it?
+3
A:
Maybe you can use exec task to execute
iisreset -stop
iisreset -start
EDIT : And this VBS might help for stopping/starting WebApplications under IIS
Here is the accespted solution to stop a website with nant task on IIS :
<target name="stopSite">
<exec program="cscript.exe">
<arg value="C:\windows\system32\iisweb.vbs" />
<arg value="/stop" />
<arg value="test" />
</exec>
</target>
Canavar
2009-02-25 14:16:21
Thank's for reply, but your solution is unsuitable for me. I want stop only one chosen site, not the whole server.
innerJL
2009-02-25 14:24:42
I add a new link that shows how to stop/start web site on command line. Hope this helps.
Canavar
2009-02-25 14:32:15
Great, I found solution with your help: <target name="stopSite"> <exec program="cscript.exe"> <arg value="C:\windows\system32\iisweb.vbs" /> <arg value="/stop" /> <arg value="test" /> </exec> </target> Please update your answer, so anybody can easily find it
innerJL
2009-02-25 16:12:53
Is this supposed to work outside of Win Server 2003?
Dov
2010-08-23 15:53:58
+5
A:
Nant has the servicecontroller task with which you can either stop/start just the Web server or entire IIS, i use it generally to just stop/start the web server.
<servicecontroller action="Stop" service="w3svc"
timeout="10000" verbose="true" />
Documentation available at http://nant.sourceforge.net/release/latest/help/tasks/servicecontroller.html
Dinesh Manne
2009-02-25 14:38:17