Starting and Stopping Web Sites
There are times when a Web site must be either stopped or started. You might stop a Web site for maintenance or for security reasons. It is obvious why a Web site needs to be started: A Web site that is not running is useless as a Web site! To stop or start a Web site, use the WMI classes supplied by the IIS 7 WMI provider.
The StartStopSite.ps1 script is an example of a script that can be used to start and stop Web sites. It begins with the param statement and defines a number of parameters. The -site parameter names the Web site to be either stopped or started. The other parameters are optional. The -start parameter is a switched parameter and, if present, causes the script to start the Web site. The -stop parameter ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access