IIS site and nant / nantcontrib?

Is it possible to manage IIS web applications using NAnt? For example, stop or start it?

+4
source share
3 answers

Perhaps you can use the exec task to execute

iisreset -stop iisreset -start 

EDIT: And this VBS can help to stop / start WebApplications in IIS

The following is a decision to shut down a website using NIS:

 <target name="stopSite"> <exec program="cscript.exe"> <arg value="C:\windows\system32\iisweb.vbs" /> <arg value="/stop" /> <arg value="test" /> </exec> </target> 
+4
source

Nant has a servicecontroller task with which you can stop or start only the web server or the entire IIS, I usually use it to just stop / start the web server.

 <servicecontroller action="Stop" service="w3svc" timeout="10000" verbose="true" /> 

Documentation is available at http://nant.sourceforge.net/release/latest/help/tasks/servicecontroller.html

+7
source

If you enjoy using Powershell yourself or calling a powerhell script through Nant, this will be a breeze.

 IIS:\>Stop-WebAppPool -Name "DefaultAppPool" IIS:\>Start-WebAppPool -Name "DefaultAppPool" 

You can download the snap here http://www.iis.net/download/PowerShell

Some notes on its use: http://technet.microsoft.com/en-us/library/ee790599.aspx

You can also start / stop individual websites.

0
source

All Articles