"vhk"
> Am fairly new to powershell 1.0 ,
> couple questions regarding the
> best way to use powershell for
> IIS 6 administration Mmm is one asking for too much in one post?
But perhaps the below objects will allow one
to slowly start to get a ton of information from
IIS (metabase too) or other web servers, or
databases or even simple (or very complex)
queries for other type of businesses too.
For example cafe cooks:
Show in either text or chart output,
to the cooks
on a screen in the kitchen,
just what veg or drink is ordered
the most often
with what meat or fish!
Yep plain old data parsing, no matter
what the business is! Same idea and
objects used for one's IIS servers!
And if the cooks
(just like network admins),
get this information as soon as
the information is in the system,
then the cooks too,
have a real-time data monitoring system,
that displays output to those always on
(control room screens) or here the screen
used by the cooks. And all this with a few
every day objects!
First the main control object:
Microsoft's Windows PowerShell
(Controls what data to get and how
to display it.)
Second the data workers:
For IIS and many others perhaps
Microsoft's Log Parser 2.2
(parses data) whether for the cafe's
nightly information or accessing many
IIS servers or remote AD or whatever.
Sure PowerShell itself can be the data
worker.
Third the report makers:
Yes one can use PowerShell to
create the text based reports or
use Log Parser's built-in output
formats. Including Log Parser's
chart output or the placing of the
parsed data into Log Parser's user
created pre-prepared output files (HTML,
etc.). Log Parser fills in the pre-defined
blank spots, with the newly obtained
parsed data, right into the file or
database!
Oh and by the way, for it's chart output,
Log Parser is just using Microsoft's
ChartSpace objects (commonly called
Excel Charting). Yes, after learning the
ChartSpace objects usage, PowerShell
itself can call these objects and make
charts too!
And finally the report viewers:
(Of course paper copies too)
Microsoft's PowerShell Console
Microsoft's Internet Explorer
Microsoft's Http Application (HTA)
Microsoft's Gadgets
Microsoft's .NET Framework Forms
Perhaps an example of using PowerShell
as the "controller" and data parser, to get
some process information ( instead of an
IIS example, so all can follow along). And
then passing the data to Log Parser,
used as both a data parser and a report
maker (with it's chart output), and finally,
the report viewing part, IE to see the chart.
Start example:
get-wmiobject win32_process |
where-object { $_.Name -match "pow" } |
select-object ProcessId, ThreadCount |
LogParser.exe "SELECT field1 AS PID, `
field2 AS ThreadCount `
INTO pieChartThreadCounts.gif `
FROM STDIN " `
-i:tsv -headerRow

ff -nSkipLines:3 `
-nFields:2 -iSeparator:"space" -q

n `
-o:chart -chartType:PieExploded `
-categories

ff -values

n -view

ff `
-chartTitle:"PowerShell`nThread Counts"
$ie7 = new-object -COM InternetExplorer.Application
$ie7.Navigate2("file://$pwd\pieChartThreadCounts.gif")
$ie7.Visible = $true
End example.
In the above Log Parser is using the
TSV input format -skipping lines and
creating space defined fields and then
producing chart output. If one changes
the -view

ff to -view

n then Log
Parser, besides making and saving the
chart, will also display the chart.
So with the everyday Windows objects
usage shown above, one can just start
slowly with one's IIS (or cafe) data parsing
and viewing queries. Perhaps search the
internet for other IIS Log Parser examples
(or whatever type of data parsing needs).
Perhaps post one's IIS (and other) examples
too.
Then (after trying to make it work), ask here,
one point at a time questions, that perhaps the
other PowerShell users can answer for you.
Good Luck