Tải bản đầy đủ (.pdf) (5 trang)

Exchange SQL And IIS- P145 pptx

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (296.63 KB, 5 trang )

Getting Started with IIS 7.0 • Chapter 12 697
WMI with Logical Layout, Strong Support
for PowerShell
IIS 7.0 includes a new WMI provider that provides access to confi guration and server state
information to people using VBScript, Jscript, and Windows PowerShell. Because IIS 7.0 is
modularized, to take advantage of the capabilities of WMI in IIS you must enable the feature allowing
you to use WMI with IIS 7.0. Figure 12.15 shows the IIS Management Scripts and Tools feature
being enabled in Longhorn Server.
Figure 12.14 IIS Manager in IIS 7.0
Manager use, are typically already opened on the fi rewall. IIS Manager is completely extensible,
allowing the creation of custom modules that add new functionality. For example, a developer could
create a diagnostics module used to view event viewer data relevant to IIS. Figure 12.14 shows the
new IIS Manager interface.
698 Chapter 12 • Getting Started with IIS 7.0
WMI is used to build scripts for Web administration, such as accessing, reading, and modifying
key confi guration fi les such as ApplicationHost.confi g and Web.confi g, the fi les that replaced the old
metabase. Script writers have the ability to add, remove, or edit any part of the IIS 7.0 confi guration.
For example, WMI scripts have the ability to add modules at either the global or section level,
confi gure custom HTTP errors, Multipurpose Internet Mail Extensions (MIME) Maps, Secure
Sockets Layer (SSL) bindings, and ASP settings. WMI scripting in IIS 7.0 continues to be important
for automating frequently repeated tasks, such as creating Web sites.
One can view the logical layout of WMI namespaces of IIS 7.0 by using WMI CIM studio,
which can be downloaded for free at www.microsoft.com/downloads/details.
aspx?FamilyID=6430f853-1120-48db-8cc5-f2abdc3ed314&DisplayLang=en.
Another way of accessing WMI is through PowerShell. PowerShell is a new command-line
scripting technology created by Microsoft to provide administrators with control and automation of
system administration tasks. The PowerShell script, which we will call PowerWMI.ps1, will retrieve
information from the Win32_Process class and echo back the Name and WorkingSetSize for each
item. The results are shown in Figure 12.16. The following is the PowerShell script.
Figure 12.15 Enabling WMI for IIS 7.0
Getting Started with IIS 7.0 • Chapter 12 699


$strComputer = “.”
$colItems = get-wmiobject -class “Win32_Service” -namespace “root\cimv2” -
computername $strComputer
foreach ($objItem in $colItems) {
write-host $objItem.Name, $objItem.State
}
Figure 12.16 Using PowerShell with WMI
IIS 7.0 now includes a new WMI provider used to access both confi guration and server state
information. Developers and administrators alike can use VBScript, Jscript, and Windows PowerShell
to take advantage of this. By using WMI CIM Studio, we can view the logical layout of objects and
classes in a WMI namespace.
700 Chapter 12 • Getting Started with IIS 7.0
AppCmd: Swiss Army Knife for
IIS Administrators and Developers
A major improvement in the administration of IIS 7.0 comes in the form of the command line utility
Appcmd.exe. Think of the eight scripts mentioned earlier that IIS 6.0 administrators needed to know.
Now think of having all of that capability tied into one command. Appcmd.exe provides a comprehensive
set of management functionality and better support for bulk operations than the user interface.
Appcmd.exe makes it easy to read and write confi gurations, access site and application pool state
information, create virtual directories, and perform any other administrative task directly from the
command line. Other abilities include starting and stopping sites, recycling application pools, listing
the running worker processes, and examining currently executing requests. It supports linked
operations like those found in Windows PowerShell, which allows multiple operations on a related
set of objects to be performed together from a single command line. It’s no wonder that Appcmd.exe
is called the Swiss Army knife for IIS Administrators and Developers. Figure 12.17 shows Appcmd.exe
performing numerous commands.
Figure 12.17 Appcmd.exe
Diagnostics 101
IIS 7.0 provides new tools to help debug applications and monitor the server. The following are two
new features available to both administrators and developers:


Runtime State and Control API (RSCA)

FREB
Getting Started with IIS 7.0 • Chapter 12 701
Runtime State and Control API (RSCA)
RSCA allows developers to see running requests on a server in real-time. This feature exposes the
active state of sites and application pools and running worker processes. RSCA allows administrators
to start and stop sites and recycle application pools. This capability comes in handy when investigating
server issues or tuning server performance, because being able to quickly see what is going on in the
system itself and controlling it while troubleshooting is powerful. To break it down, RSCA does the
following:

Provides in-process state information (current processes running, application pools process
ID, currently executing requests, and AppDomains loaded)

Real-time starting and stopping of sites
FREB
When a user informs you that there is a problem with the Web server, the fi rst thing you do is try to
reproduce the problem; however, a lot of times you can’t. That’s where FREB comes into play.
Possibly the most anticipated feature in IIS 7.0, it does the following:

Traces all requests through the pipeline

Identifi es requests that are stuck or failing

Identifi es time taken in each module, helping to analyze long running requests

Provides that there be no need in reproducing the error for tracing failed requests


Administrators can confi gure custom failure defi nitions per Universal Resource Locator
(URL) based on time-taken or HTTP status and sub-status codes)
To use FREB you must create at least one failed request tracing rule where you can set the trace
attributes per site or per application. This then allows you to capture an XML-formatted log of
a specifi c problem when it occurs. As stated earlier, administrators and developers will no longer
have to reproduce the problem.
FREB can also be left enabled on a server, allowing administrators and developers the ability to
continuously capture trace logs for requests that have encountered a confi gurable failure condition,
while avoiding any performance of saving trace logs. This allows you to capture information when
errors occur, even if it’s an intermittent problem. This eliminates the diffi cult task of having to
conduct deep debugging of issues.
Because the tracing infrastructure is exposed to IIS modules and the server’s extensible model,
all components, whether they came with IIS or were developed by a third party, can emit detailed
tracing information during request processing. You can even write your own modules that provide
data to IIS 7.0’s trace fi les information.
Figure 12.18 shows an example of setting up the location of where the XML-formatted log will
reside after you set up FREB.

Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×