Using PowerShell to get web site run-time data

Source: Internet
Author: User
Tags iis

Introduced

Site startup, stop, application pool back or expiration (Time out), received requests and sent responses, AppDomains (application domain) of a large number of

Build and close. IIS7 implements a so-called RSCA interface (run-time State and control API) that allows you to monitor what the current system is doing

Job.

IIS 7.0 PowerShell Provider uses this interface and exposes some of its data information in the IIS Provider name space. Through Get-webitemstate,

Start-webitem, Stop-webitem, and Restart-webitem cmdlets to configure the state of the site and application pools. Exposed through the IIS name space

Out of the runtime state such as the currently running worker process, the currently executing request and the loaded application domain (loaded appdomains), and so on.

The sites, applications, and virtual directories used in this article have been created in the previous article.

Site and application pool status

Start querying the status of the Web site.

Site Status

PS IIS:\> cd Sites
PS IIS:\Sites> Get-WebItemState IIS:\Sites\DemoSite
Started

To stop a site using the Stop-webitem cmdlet:

PS IIS:\Sites> Stop-WebItem DemoSite
PS IIS:\Sites> Get-WebItemState IIS:\Sites\DemoSite
Stopped

Of course, the start of the site is also similar to the work:

PS IIS:\Sites> Start-WebItem DemoSite
PS IIS:\Sites> Get-WebItemState IIS:\sites\DemoSite
Started

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.