Reputation: 71
In our company we have multiple projects in single IIS server and I am working on build automation via using CruisControl. My question is I have to restart a particular IIS site after deployment without entering into server or Via using CruiseControl jobs.
Does anyone have any idea?
Upvotes: 2
Views: 14267
Reputation: 414
I found no method for now to restart any site individually, however using IISAdministration power shell module we can automate process or we can have use into our script to auto restart a site
Stop-IISSite -Name $web -Confirm:$false #$web provide IIS site name
Once site is stopped you can start again(restart)
Start-IISSite -Name $web
Upvotes: 2
Reputation: 71
Well I got answer for this :) So I used a batch script for IIS Stop/Start and executed it from CruiseControl Dashboard. You can use below batch script if you do not have Admin permission for appcmd execution.
** Below location is default in all system (may be defer)
create separate batch file for Stop and Start and Run it from CCnet job.
"C:\Windows\System32\inetsrv\appcmd stop site qwerty"
-- Stops Site 'qwerty'
"C:\Windows\System32\inetsrv\appcmd start site qwerty"
-- Starts Site 'qwerty'
let me know if this helps!
Upvotes: 3
Reputation: 5443
You can start an individual Web site without affecting the operation of any other Web site that is being that is supported by a server that is maintained by Internet Services Manager.
To start an individual Web site that has previously been stopped:
Log on to the Web server computer as an administrator.
Click Start, point to Settings, and then click Control Panel.
Double-click Administrative Tools, and then double-click Internet Services Manager.
Right-click the Web site that you want to start in the left pane, and then click Start.
CommandLine:
Command Line To start or stop a Web site, use the following syntax:
appcmd start | stop site /site.name:string
The variable string is the name of the Web site that you want to start or stop. For example, to stop a Web site named contoso, type the following at the command prompt, and then press ENTER:
appcmd stop site /site.name: contoso
Hoping this will help you :)
Upvotes: 1