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>
source share