IT:AD:MSDeploy:HowTo:Start and Stop Websites
Summary
After backing up a website (IT:AD:MSDeploy:HowTo:Backup a Remote Website), once can consider whether to turn off the website while working on it.
Process
If working on the server itself, one could use AppCmd to do it.
But working remotely, one would prefer using IT:AD:MSDeploy and it's -runCommand param:
Stopping a WebSite
msdeploy
-verb:sync
-source:runcommand
-dest:runcommand="%windir%\system32\inetsrv\appcmd stop site /site.name:"Default Web Site"
If remotely, add the computername/username/password as required:
msdeploy
-verb:sync
-source:runcommand
-dest:runcommand="%windir%\system32\inetsrv\appcmd stop site /site.name:"Default Web Site", computername=192.168.0.2,userName=Administrator,password=Password1,waitinterval=15000
Starting a WebSite
Starting a website is basically the same:
msdeploy
-verb:sync
-source:runcommand
-dest:runcommand="%windir%\system32\inetsrv\appcmd start site /site.name:"Default Web Site"